View Single Post
  #1 (permalink)  
Old 08-10-2007, 12:47 PM
HelloWorld's Avatar
HelloWorld HelloWorld is offline
PT Admin
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,118
iTrader: (0)
HelloWorld is a jewel in the roughHelloWorld is a jewel in the roughHelloWorld is a jewel in the rough
Icon4 namespace std help!!!

This is really stressful lol... why doesn't it work? I don't see anything wrong with my code, here's my code and the error message:

Code:
#include<iostream>
#include"stdafx.h"
#include<stdlib.h>
usingnamespace std;
int main() {
int dice1 = 1 + rand() % 6;
int dice2 = 1 + rand() % 6;

cout << "Welcome to Carps" << endl;
return 0;
}
Error message:
Code:
1>------ Build started: Project: Carps, Configuration: Debug Win32 ------
1>Compiling...
1>Carps.cpp
1>c:\documents and settings\lltl16\my documents\visual studio 2005\projects\carps\carps\carps.cpp(5) : error C2871: 'std' : a namespace with this name does not exist
1>c:\documents and settings\lltl16\my documents\visual studio 2005\projects\carps\carps\carps.cpp(11) : error C2065: 'cout' : undeclared identifier
1>c:\documents and settings\lltl16\my documents\visual studio 2005\projects\carps\carps\carps.cpp(11) : error C2065: 'endl' : undeclared identifier
1>Build log was saved at "file://c:\Documents and Settings\lltl16\My Documents\Visual Studio 2005\Projects\Carps\Carps\Debug\BuildLog.htm"
1>Carps - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


here's one reason why that I think I should learn this by using Textpad instead lol.. so that I know what's really behind everything that Visual Studio has

__________________
PHP Code:
System.out.println("Hello World!"); 

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote