Sign in to follow this  
Road To Chaos

Need help with VC++ express edition 2005

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
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
Quote:
Original post by Road To Chaos
Found out. I would goto Build -> then build -> compile but never actually went to debug -> start debugging Im free from this!

Yeah hit Ctrl+F5 and you won't have to mess with any of the system nonsense which I'm not even sure what compiler/s that works on?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this