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 