#ifndef   是为了防止一个源文件多次include同一个头文件。
No, it's not the same.

If your compiler supports "#pragma once",
It will ignore the rest of the header file when it finishes reading this line.
But if you use "#ifndef xxx", "#define xxx", "...", "#endif",
the compiler will go on parsing this file because it thinks that
  there may be some more lines of code after "#endif",
it dare not to drop the rest of the file.

As you see,
if the compiler supports "#pragma once",
using "#pragma once" will accelerate the compiling process.
So people usually write header file like this:

#ifndef XXX
#define XXX

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER

...
...

#endif // XXX