Thread: type specifier question

  1. #1
    Back after 2 years Panopticon's Avatar
    Join Date
    Dec 2002
    Posts
    262

    type specifier question

    Are there a set order for which specifiers must follow? e.g
    consider:
    Code:
    extern const volatile static unsigned long int i;
    Is the above the same as this:
    Code:
    long extern const static unsigned volatile int i;
    I AM WINNER!!!1!111oneoneomne

  2. #2
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078
    Storage class specifiers (IE extern, static, auto) should be first.

    Also, you used both extern AND static, which is not valid.

    EDIT: Hm, actually, I'm not sure if storage class specifiers HAVE to be first, but I was told they did a while back, and Comeau in strict mode issues a warning when they are not first.

    Still, try to keep the storage class specifiers first.
    Last edited by Polymorphic OOP; 01-21-2003 at 07:53 PM.

  3. #3
    Back after 2 years Panopticon's Avatar
    Join Date
    Dec 2002
    Posts
    262
    Thanks for your explanation. Another question, I assume non-global variables are placed on a stack, and that stack is usually the RAM? Im wondering, for big programs like games, where the amount of variables exceed the RAM limits and they have to be stored on the harddisk, would pointers storing addresses of variables stored on a harddisk still work?
    I AM WINNER!!!1!111oneoneomne

  4. #4
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078
    They just don't load everything in memory at once. Data is dynamically allocated and deallocated on the heap. You don't use the hard drive for variables. You can't have pointers to "variables" on a hard drive.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Quantum Random Bit Generator
    By shawnt in forum C++ Programming
    Replies: 62
    Last Post: 06-18-2008, 10:17 AM
  2. failure to import external C libraries in C++ project
    By nocturna_gr in forum C++ Programming
    Replies: 3
    Last Post: 12-02-2007, 03:49 PM
  3. Replies: 28
    Last Post: 07-16-2006, 11:35 PM
  4. Question type program for beginners
    By Kirdra in forum C++ Programming
    Replies: 7
    Last Post: 09-15-2002, 05:10 AM
  5. Newbie question about the Private type in classes
    By Ryeguy457 in forum C++ Programming
    Replies: 1
    Last Post: 09-07-2002, 10:17 PM