Microsoft visual c++ 2010 express how to i fix - Error: identifier "cout" is undefined?
-
i have recently started programing using microsoft visual c++ 2010 express and the error "Error: identifier "cout" is undefined" keeps coming up when ever i type cout or cin . also it worked before when i made a simple calculator but it wont work now here is the code : // project1.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <vector> #include <string> using namespace std; int main () { double num1 , num2 , result,; int choose; cout << " enter number 1"; cin >> num1; cout << "enter number 2"; cin >> num2; cout << "1. add 2.subtract 3.divide 4.multiply: "; cin >> choose; if (choose == 1) result = num1 + num2; else if (choose == 2) result = num1 - num2; else if (choose == 3) result = num1 / num2; else if (choose ==4) result == num1 * num2; cout << "your result is: " << result << endl; return 0; }
-
Answer:
Add #include <iostream> a the beginning and it should fix it.
Jake at Yahoo! Answers Visit the source
Related Q & A:
- How can I fix parser Error in ASP.NET?Best solution by parse.com
- How do I fix the "Specified path is too long" error?Best solution by itcsupport.wordpress.com
- Why am I receiving a malformed text data error and how do I fix it?Best solution by Yahoo! Answers
- How do I fix a Spooler subsystem app error?Best solution by Yahoo! Answers
- How do I fix this error I have on MSN? "Windows Live Communications Platform has stopped working?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.