Discussion Board

Results 1 to 5 of 5
  1. #1
    Nokia Developer Champion girishpadia's Avatar
    Join Date
    Aug 2010
    Location
    Ahmedabad
    Posts
    288
    Hello Everyone,

    I am new to Qt programing. I have seen following two different syntax to include files.

    #include <Class>


    and

    #include "HeaderFile.h"

    I could not get the fundamental difference between this two syntax. I understand that the first one include the class and second one includes the header file. But I am unable to understand which syntax to use in different circumstances.Which syntax consumes more memory ?

    Many thanks in advance.
    Regards,

    Girish Padia

  2. #2
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,673
    here's one answer: http://www.geekpedia.com/KB113_What-...otandquot.html

    Basically you would use "" for local includes

  3. #3
    Nokia Developer Champion girishpadia's Avatar
    Join Date
    Aug 2010
    Location
    Ahmedabad
    Posts
    288
    Thanks symbianyucca,

    The link explains the difference for C++. How Qt interpretes both ? Because I have seen following syntax in Qt Examples.

    #ifdef Q_OS_SYMBIAN
    #include "qsysteminfo.h"
    #else
    #include <QSysInfo>
    #endif

    Does it depend on the target device to compile ?
    Regards,

    Girish Padia

  4. #4
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,673
    QT is C++ in the end, so would consider it to work same way. Though your example, appears to say that Symbian version would not make any difference on them. Anyway for future compatibility, it would be better to stick on doing it as it should be done..

  5. #5
    Nokia Developer Champion danhicksbyron's Avatar
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209
    "<>" is used for the standard header files -- searches a "wired in" list of headers -- while "" searches both the standard header file list and the list of header files supplied by the complier user (or the toolkit). In general one can use "" instead of <>, so long as the header file being referenced isn't duplicated in the user-supplied list (which is generally a bad idea anyway). Using <> instead of "" is less likely to work, however.

    (The whole thing is really a little bit silly, and if it were done all over again it's likely that a different scheme would be used -- either no distinction at all or a finer-grained distinction.)

    Note that this has nothing to do with whether the header file ends in ".h" or not -- if you look at the "QSysInfo" (no ".h") header file, for instance, it's just a #include for another header file (this one with ".h").

Similar Threads

  1. can DIALOG include "item" and "form" both?
    By RichieChyi in forum Symbian C++
    Replies: 2
    Last Post: 2008-05-08, 10:29
  2. Can't open included files failure. "#include <coeccntx.h>"
    By Series80user in forum Symbian C++
    Replies: 1
    Last Post: 2005-08-03, 09:26
  3. <a href="test.mid">Midi</a> doens't works!
    By ernestkok in forum Mobile Web Site Development
    Replies: 0
    Last Post: 2004-02-20, 09:35

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved