How to initialize an array

This is a discussion on How to initialize an array within the C++ Programming forums, part of the General Programming Boards category; If we have class called cousre and we want to initialize a private mmbr which is an array of 5 ...

  1. #1
    Registered User
    Join Date
    Aug 2012
    Posts
    6

    How to initialize an array

    If we have class called cousre and we want to initialize a private mmbr which is an array of 5 students
    Do we use pointers for that?

  2. #2
    Registered User
    Join Date
    Aug 2003
    Posts
    1,198
    Try it.

  3. #3
    Registered User
    Join Date
    Aug 2012
    Posts
    6
    If i could i would!:/

  4. #4
    Registered User
    Join Date
    Oct 2006
    Posts
    2,289
    what's preventing you from trying it?

  5. #5
    Registered User
    Join Date
    Aug 2012
    Posts
    6
    Oki so if yu dont have an answer keep ur comments for yourself plz (:

  6. #6
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,648
    Wah! Just gimme da codes!

  7. #7
    Registered User
    Join Date
    Aug 2012
    Posts
    6
    I just asked the most easiest question and no one can answer!!:/

  8. #8
    ZuK
    ZuK is offline
    Registered User
    Join Date
    Aug 2005
    Location
    Austria
    Posts
    1,990
    Quote Originally Posted by Tima92 View Post
    I just asked the most easiest question and no one can answer!!:/
    Guess we could. But the question is just too easy.
    Kurt

  9. #9
    Registered User
    Join Date
    Aug 2003
    Posts
    1,198
    No we won't answer you straight up because you have not shown any effort at all at trying to come up with the answer yourself. Just giving you some code will not help you become a better programmer, and we don't work like that.
    I just asked the most easiest question and no one can answer!!:/
    If the question is so easy why did you come here in the first place?

    Show some effort and come back with a specific question (concerning a compiler error, some runtime error or something like that) and we will gladly help.

  10. #10
    Registered User
    Join Date
    Aug 2012
    Posts
    6
    Am not a programmer :P
    And its not the code am stuck in am just confused thats it!
    I want to knw if i have to use pointers or i can just say char student[5]:/
    Plus i dnt have my laptop to try thats y i asked

  11. #11
    Registered User
    Join Date
    Aug 2003
    Posts
    1,198
    There are compilers online: codepad

    Programmer or not, this smells like assignment work so you'll either have to figure it out yourself or live your life not knowing...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Error while trying to initialize array /:
    By tmrsgv in forum C Programming
    Replies: 6
    Last Post: 04-21-2012, 05:04 AM
  2. Replies: 8
    Last Post: 09-15-2009, 03:14 AM
  3. initialize 2D array!
    By samirself in forum C Programming
    Replies: 1
    Last Post: 03-10-2005, 10:56 AM
  4. how to initialize a new array
    By Chiel in forum C++ Programming
    Replies: 4
    Last Post: 08-25-2003, 01:30 PM
  5. Initialize an array
    By cheesehead in forum C++ Programming
    Replies: 6
    Last Post: 12-12-2001, 03:28 PM

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