Thread: need help for stack problem again

  1. #16
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    >> it holds chars and ints
    An array cannot hold more than one type. If you are storing more than one type of data in an array, you put that data into a struct. That struct is a type. Then your array holds that type.

    So in your case, while your array does hold chars and ints, those chars and ints are held inside a struct named car. It is that type that you should use declare your array.

    Do you see how the spaces array holds cars, not chars and ints?

  2. #17
    Registered User
    Join Date
    Sep 2006
    Posts
    15
    ok, I think I fix every thing, no errors but 2 warnnig
    this is a warning:
    local variable 'Hr' used without having been initialized
    local variable 'Min' used without having been initialized

  3. #18
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    Those probably need to be initialized. Perhaps by using milhours and milmin?

  4. #19
    Registered User
    Join Date
    Sep 2006
    Posts
    15
    what do you mean by milhours and milmin?

  5. #20
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    >what do you mean by milhours and milmin?

    Local variables need to be assigned a value, Daved was giving you an example
    Double Helix STL

  6. #21
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    >> what do you mean by milhours and milmin?
    Hr and Min are being used without having any value given to them. That function takes a parameter called milhours and one call milmin. My guess is that you use those values to initialize Hr and Min to some value so you can use them in your function.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM