Posted March 4, 200718 yr I just started using Visual C++ 2005 and the whole program is extremely foreign to me (I'm used to using Borland) and I have already run into problems, I keep on getting build errors with a program that realistically should work. This is the build output 1>------ Build started: Project: Lesson_2, Configuration: Debug Win32 ------ 1>Compiling... 1>main.cpp 1>c:\documents and settings\evan\my documents\visual studio 2005\projects\lesson_2\lesson_2\main.cpp(9) : error C2065: 'cout' : undeclared identifier 1>c:\documents and settings\evan\my documents\visual studio 2005\projects\lesson_2\lesson_2\main.cpp(9) : error C2065: 'endl' : undeclared identifier 1>c:\documents and settings\evan\my documents\visual studio 2005\projects\lesson_2\lesson_2\main.cpp(11) : error C2065: 'cin' : undeclared identifier 1>Build log was saved at "file://c:\Documents and Settings\Evan\My Documents\Visual Studio 2005\Projects\Lesson_2\Lesson_2\Debug\BuildLog.htm" 1>Lesson_2 - 3 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== and this is the code I am trying to compile #include <iostream> #include <conio.h> #include <stdio.h> int main() { cout <<"What number do you want to use?"<<endl; int mynum; cin >>mynum; mynum = mynum * 2; cout <<"The answer is "<<mynum<<endl; return 0; } Very simple stuff but it has stumped me, anybody willing to help?
March 4, 200718 yr AGYAGHAHAHHAHAHAHAHHAHAHAHJHAHAHAHHAHAHAHAGHGAHAHAHAHAHHAHAHAHAHAHAHHAHAHAHAJHAHHAJHAHAH AHAHA THANK YOU, THANK YOU FOR MAKING MY NIGHT!
March 4, 200718 yr #include <iostream> #include <conio.h> #include <stdio.h> int main() { cout <<"What number do you want to use?"<<endl; int mynum; cin >>mynum; mynum = mynum * 2; cout <<"The answer is "<<mynum<<endl; return 0; } that dont make sense! 1>------ Build started: Project: Lesson_2, Configuration: Debug Win32 ------ 1>Compiling... 1>main.cpp 1>c:\documents and settings\evan\my documents\visual studio 2005\projects\lesson_2\lesson_2\main.cpp(9) : error C2065: 'cout' : undeclared identifier 1>c:\documents and settings\evan\my documents\visual studio 2005\projects\lesson_2\lesson_2\main.cpp(9) : error C2065: 'endl' : undeclared identifier 1>c:\documents and settings\evan\my documents\visual studio 2005\projects\lesson_2\lesson_2\main.cpp(11) : error C2065: 'cin' : undeclared identifier 1>Build log was saved at "file://c:\Documents and Settings\Evan\My Documents\Visual Studio 2005\Projects\Lesson_2\Lesson_2\Debug\BuildLog.htm" 1>Lesson_2 - 3 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== post this lesson please then you wil get better help :)
March 4, 200718 yr Author post this lesson please then you wil get better help :) The lesson is at http://forum.gamedeception.net/showthread.php?t=1222 I know alot of the stuff in this lesson already (I know pretty much all the basics except pointers) but I'm still going through it as a review and have already been stumped by not the code but the compiler. :thinker:
March 4, 200718 yr Help with Visual C++ 2005 express During the next few C++ lessons, you will learn the basics of the Microsoft Visual C++ 6.0 compiler and how to compile simple and operating programs. http://forum.gamedeception.net/showthread.php?t=1222 <.< For beginner C++ lessons try http://newdata.box.sk/bx/c/ Visual C++ is prolly not the best for your needs try dev cpp http://www.bloodshed.net/
March 8, 200718 yr I just started using Visual C++ 2005 and the whole program is extremely foreign to me (I'm used to using Borland) and I have already run into problems, I keep on getting build errors with a program that realistically should work. and this is the code I am trying to compile #include <iostream> #include <conio.h> #include <stdio.h> int main() { cout <<"What number do you want to use?"<<endl; int mynum; cin >>mynum; mynum = mynum * 2; cout <<"The answer is "<<mynum<<endl; return 0; } Very simple stuff but it has stumped me, anybody willing to help? try this... #include<iostream> using namespace std; int main(){ int mynum; cout <<"What number do you want to use?"<<endl; cin >>mynum; mynum = mynum * 2; cout <<"The answer is "<<mynum<<endl; return 0; }