Thread: Last Minute Reviewing

  1. #16
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    In that way? Yes.
    The [4] isn't strictly necessary... You can write objects[] too, but you can't omit it.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  2. #17
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Quote Originally Posted by jw232 View Post
    Code:
    ExampleClass objects[4] = {1,2,3,4};
    Is initializing objects in that array only possible because the constructor only takes one argument? Is the [4] necessary?
    That and the constructor that takes one argument isn't labelled explicit. In such a case, initializing an array of objects won't compile.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Wait just a minute here!!!
    By Kennedy in forum C Programming
    Replies: 7
    Last Post: 04-13-2009, 09:36 AM
  2. Printing System time and 30 minute alarm
    By kevndale79 in forum C Programming
    Replies: 16
    Last Post: 10-17-2006, 05:10 AM
  3. Replies: 4
    Last Post: 05-13-2003, 04:54 PM
  4. Replies: 3
    Last Post: 12-16-2002, 09:55 AM