studious01
asked on
Errors in code
Hi everyone,
I am a beginning programmer in C++ learning this on my own with the help from fellow experts-exchange comrades, with two question hoping someone can help. The first, I would like two get everyone's input on which is the best way to learn the C++ programming language? On your own or in an acedemic environment ?
The second, I am trying to compile this source file taken from Sams teach yourself C++ in 21days Ex.1. p.21 using Borland's C++ Comiler 5.5.1, but i am getting these error messages:
//Exercise 1 ch.1
#include <iostream>
int main()
{
int x = 5;
int y = 7;
std::cout << "\n";
std::cout << x + y << " " << x * Y;
std::cout << "\n";
return 0;
}
Warning W8084 Ex1.cpp 10: Suggest parenthesis to clarify precedence in function main()
Error E2451 Ex1.cpp 10: Undefined symbol in function main()
Warning W8004 Ex1.cpp 13: 'x' is assigned a value that is never used in the function main()
Warning W8004 Ex1.cpp 13: 'y' is assigned a value that is never used in the function main()
****1 errors in compile****
Thanks, it's great to have joined a site with so much IT related assistance and information!!!!
Studious01
I am a beginning programmer in C++ learning this on my own with the help from fellow experts-exchange comrades, with two question hoping someone can help. The first, I would like two get everyone's input on which is the best way to learn the C++ programming language? On your own or in an acedemic environment ?
The second, I am trying to compile this source file taken from Sams teach yourself C++ in 21days Ex.1. p.21 using Borland's C++ Comiler 5.5.1, but i am getting these error messages:
//Exercise 1 ch.1
#include <iostream>
int main()
{
int x = 5;
int y = 7;
std::cout << "\n";
std::cout << x + y << " " << x * Y;
std::cout << "\n";
return 0;
}
Warning W8084 Ex1.cpp 10: Suggest parenthesis to clarify precedence in function main()
Error E2451 Ex1.cpp 10: Undefined symbol in function main()
Warning W8004 Ex1.cpp 13: 'x' is assigned a value that is never used in the function main()
Warning W8004 Ex1.cpp 13: 'y' is assigned a value that is never used in the function main()
****1 errors in compile****
Thanks, it's great to have joined a site with so much IT related assistance and information!!!!
Studious01
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, nagraves that did!
Just required a little more effort.
Just required a little more effort.
To me, it just helps to have someone around that knows what they're doing to explain things.
Try using parens around the x + y and x * y and it will work. also on that same line, change it from a Y to a y.