PDA

View Full Version : About include 'styles'



tonnot
21st September 2010, 17:55
I have seen a few distinct include sintax :

#include <QtGui/QApplication>
#include <QApplication>
#include "QtGui/QApplication"

All of them are valid ? Any explanation?

wysota
21st September 2010, 17:59
All of them are valid ?
Yes.

Any explanation?
The explanation is all three syntaxes are valid for C/C++.

tbscope
21st September 2010, 18:11
#include "A"
Looks for A in the source directory first, then in the other directories known by the compiler.


#include <A>
Does not look for A in the source directory first, but in the directories known by the compiler.


#include <A/B>
Looks for A/B in the know directories.

Edit: this is basic C++ by the way. If you look this up in google or any good book store you find tons of information about it.