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 953185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:00:41+00:00 2026-05-16T00:00:41+00:00

I have a C++ file like this #ifndef _MOVE_H #define _MOVE_H class Move {

  • 0

I have a C++ file like this

#ifndef _MOVE_H
#define _MOVE_H

class Move {
    int x, y;
public:
    Move(int initX = 0, int initY = 0) : x(initX), y(initY) {}
    int getX() { return x; }
    void setX(int newX) { x = newX; }
    int getY() { return y; }
    void setY(int newY) { y = newY; }
};

#endif

And to my amazement, all the code between #ifndef and #endif is simply ignored by the compiler (I swear that I am not defining _MOVE_H anywhere else), and I have all kinds of errors about missing definitions. I was thinking that I did something wrong, but when I try to use another key (like _MOVE_Ha, everything is back to normal. Does _MOVE_H mean something special in C++ ?

I’m running Ubuntu 10.04, GCC 4.4.3, if that matters.

Thanks,

  • 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-16T00:00:42+00:00Added an answer on May 16, 2026 at 12:00 am

    just run grep _MOVE_H in /usr/include/c++ on your machine

    for me :

    c++/4.5.0/bits/move.h:#ifndef _MOVE_H
    

    As a rule of thumb, don’t use things (really anything) prefixed by _ or __. It’s reserved for internal usage.
    Use SOMETHING_MOVE_H (usually name of the company, …).

    I guess it’s a new header used to add the move semantic to c++0x.

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

Sidebar

Related Questions

I have created MutexCondition class like this /*MutexCondtion.h file*/ #ifndef MUTEXCONDITION_H_ #define MUTEXCONDITION_H_ #include
I have a C header file like this: #ifndef RENDERER_H #define RENDERER_H static int
I have a header file like this: #ifndef __GEN_NOTE_MARKERS_TO_DEVELOPERS_HPP__ #define __GEN_NOTE_MARKERS_TO_DEVELOPERS_HPP__ #ifdef _DEBUG //
When I have a header file like this: #ifndef GAMEVIEW_H_ #define GAMEVIEW_H_ #include <SDL/SDL.h>
I have this .h file #ifndef VISUALSETTINGS_H #define VISUALSETTINGS_H #include <QPair> #include <QDataStream> class
I have the header file testcode.h #ifndef TESTCODE_H #define TESTCODE_H class A { public:
Well, I have a header (my_prog.h) which looks like this: #ifndef __MY_HEADER_H #define __MY_HEADER_H
I have Environment.h file: #include <windows.h> #include interfaces.h #ifndef ENVIRONMENT_H #define ENVIRONMENT_H class Environment
I have a Mammal.h file that reads: #ifndef MAMMAL_H #define MAMMAL_H class Mammal {
I have a constants.h file that looks something like #ifndef constants_h #define constants_h #define

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.