Jump to content
  • Advertisement
Sign in to follow this  
Road To Chaos

Need help with VC++ express edition 2005

This topic is 3614 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok I've download VC++ express edition 2005 and been messing around for a few minutes and Im already baffled :(
// test2.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>


int _tmain(int argc, _TCHAR* argv[])
{
	
	cout >> "hi";
	return 0;
}

With this I get this as my output 1>Compiling... 1>test2.cpp 1>c:\users\jeff\documents\visual studio 2005\projects\test2\test2\test2.cpp(11) : error C2065: 'cout' : undeclared identifier 1>Build log was saved at "file://c:\Users\Jeff\Documents\Visual Studio 2005\Projects\test2\test2\Debug\BuildLog.htm" 1>test2 - 1 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== edit :: What am I doing wrong its been a while since I tried C++ it can be an easy mistake. Im using Vista if that helps

Share this post


Link to post
Share on other sites
Advertisement
Ok I figured it out I need to add a Usuing namespace std; or std::cout

Now my next question after I build it and compile it how do I run it :D

Or is running but i need to pause it??

Share this post


Link to post
Share on other sites
Yeah, most likely, the console window closes too fast.

You can add

system("pause");

before main returns, and it'll use Windows's built-in "Press any key to continue..." thingy.

Share this post


Link to post
Share on other sites
Alright so I got this going now:



#include <iostream>

int main()
{

int i;

std::cout << "hi";
std::cin >> i;
return 0;

}




I get his message:

1>------ Build started: Project: test3, Configuration: Debug Win32 ------
1>Linking...
1>Embedding manifest...
1>Build log was saved at "file://c:\Users\Jeff\Documents\Visual Studio 2005\Projects\test3\test3\Debug\BuildLog.htm"
1>test3 - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========


So I guess everything is good. I try build and compile both are good. When I was using VC++ 6.0 the console box would come up with Express it doesn't. How do I get the program to run??

Share this post


Link to post
Share on other sites
Quote:
Original post by kiwibonga
Yeah, most likely, the console window closes too fast.

You can add

system("pause");

before main returns, and it'll use Windows's built-in "Press any key to continue..." thingy.


Ill try that right now

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!