I have C++ code from a book and would like to run it in visual C++ express 2010 but I got an error like following. Could you tell me how to run this code ? Thank you so much !
#include <iostream>
class Cat
{
public:
int itsAge;
int itsWeight;
};
int main()
{
Cat Frisky;
Frisky.itsAge = 5;
std::count << "Frisky is a cat who is ";
std::count << Frisky.itsAge << " years old.\n";
reutrn 0;
}
------ Build started: Project: chp6, Configuration: Debug Win32 ------
list6_1.cpp
list6_1.cpp(2): warning C4627: '#include <iostream>': skipped when looking for precompiled header use
Add directive to 'StdAfx.h' or rebuild precompiled header
list6_1.cpp(20): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========