Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7620365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:55:20+00:00 2026-05-31T03:55:20+00:00

I created a c++ Win32 console application in VS2010, and in a separated class

  • 0

I created a c++ Win32 console application in VS2010, and in a separated class I have.

void Thing::display(){
    Point pt(0, 0);
    for( ; pt.y < m; pt.y++){
        for( ; pt.x < m; pt.x++){
            if (pt == pi){
                std::cout << "[  ]";
            }else {
                std::cout << "[" << Array[pt.x][pt.y] << "]";
                if ( pt.x == m ){
                    std::cout << std::endl;
                }
            }
        }
    }
}

which exists in the Thing class which is split between an h, and a cpp. point is an (x, y) point, and Array is a 2D array of ints, and pi is a private member for current location tracking.it keeps throwing errors of

error C2039: 'cout' : is not a member of 'std'
error C2065: 'cout' " undeclared identifier

and it does the same thing for endl. I can go into my _tmain() and write

cout << "Hello world" << endl

with no problem. when I attempt to tell the compiler for this file

using namespace std;

it throws inteslliSense: name must be a namespace name

Edit: suggestion of putting #include into the header file caused

error C1010: unexpected end of file while looking for precompiled header. did you gorget to add '#include "StdAfx.h"' to your source?

moving the #inlcude to stdafx.h causes same.

Edit2 (resolved):

placed

#include <iostream>

into stdafx.h, and then listed header files for the program. and listed

#include "stdafx.h"

at the beginning of the .cpp files.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T03:55:21+00:00Added an answer on May 31, 2026 at 3:55 am

    Have you included iostream

    #include <iostream>
    

    in your header file?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a dll project in VS2010 (Win32 console application>dll). I put some
I created win32 console application in vs2010 (without select the option of precompiled header).
I have created a Win32 Console Application in Visual Studio but when I start
Using VS2010, I created a Win32 C++ console application called TfsBuildTestTarget. This is just
I have created a small WIN32 Console Application in Visual C++ in Windows 7.
I have a C++ Win32 application that runs as a console app if run
I created a Win32 Console application, and hide the cmd window. So if my
I have created a windows application using core WIN32 and VC++. In my parent
I created a win32 console application (without enable precompiled header option). And now my
For my c++ homework assignment, I have to write a Tic-Tac-Toe Win32 console application.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.