int = class?

This is a discussion on int = class? within the C++ Programming forums, part of the General Programming Boards category; Just wondering here: Since you declare chars and ints and so on just like classes and you can make arrays ...

  1. #1
    Pygmy Monkey ErionD's Avatar
    Join Date
    Feb 2002
    Posts
    408

    int = class?

    Just wondering here:

    Since you declare chars and ints and so on just like classes and you can make arrays of them just like classes,
    are they classes (or maybe structs)?
    And if so does anyone know how the class looks?

  2. #2
    Registered User
    Join Date
    Jan 2002
    Posts
    559
    I see what you're saying, but no, they're not classes. They're built into the language. Are they a machine or assembly equivalent of a class? Don't know that. Since their size can be machine dependant, I'd guess not.
    Truth is a malleable commodity - Dick Cheney

  3. #3
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    They are not classes. The thing they have in common is that they are all types, a certain structure of data, and you declare instances of a type in the same way wether it' a class, stucture or a variable.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. NEED HELP READING FILE and PRINTING
    By geoffr0 in forum C Programming
    Replies: 4
    Last Post: 04-16-2009, 05:26 PM
  2. Replies: 26
    Last Post: 11-30-2007, 02:51 AM
  3. Moving Average Question
    By GCNDoug in forum C Programming
    Replies: 4
    Last Post: 04-23-2007, 11:05 PM
  4. Game Won't Compile
    By jothesmo in forum C++ Programming
    Replies: 2
    Last Post: 04-01-2006, 03:24 PM
  5. getting a headache
    By sreetvert83 in forum C++ Programming
    Replies: 41
    Last Post: 09-30-2005, 05:20 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21