Thread: Dynamic Arrays

  1. #16
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,949
    Quote Originally Posted by Elysia View Post
    But the OP has not mentioned such a thing, thus we are in the dark, hence the necessary question.
    I wasn't questioning the necessity of the question, just guessing at most likely what the answer was going to be based on trends I have seen.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  2. #17
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    But again, guessing is pointless. We would probably all guess the same thing, but the point is that we don't know.
    If the OP is required to use those things, then there is not much we can do. If not, then we should steer the OP onto the correct path.
    We are trying to inquire whether we need to do that or not, so taking a wild guess here just won't cut 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.

  3. #18
    Registered User
    Join Date
    Jul 2011
    Posts
    17
    I am doing this for a class and the book that is assigned to help us actually really sucks. I've found reading stuff online and through forums helps to learn a lot more efficiently. I am a complete beginner to all of C++ and hence why some of my code rudimentary and basic.

    On the bright side, I am learning a lot even though I am being difficult by asking so much. Thank you for baring with me.

  4. #19
    Registered User
    Join Date
    Jul 2011
    Posts
    17
    Quote Originally Posted by AndrewHunter View Post
    Simply change your price array to an array of floats or doubles, e.g. double *price; and price = new (nothrow) double[items];
    I need to learn to completely follow through on my code when making edit. I had changed in the variable but failed to recognize to change it to double[items].

  5. #20
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    auto * price = new double[items];
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 2d dynamic arrays
    By zbest in forum C++ Programming
    Replies: 5
    Last Post: 12-06-2008, 12:53 PM
  2. dynamic arrays
    By s.nelson64 in forum C++ Programming
    Replies: 6
    Last Post: 11-04-2008, 06:27 AM
  3. Replies: 16
    Last Post: 01-01-2008, 04:07 PM
  4. help with dynamic arrays
    By Chaplin27 in forum C++ Programming
    Replies: 5
    Last Post: 09-03-2004, 08:22 PM
  5. Dynamic arrays
    By fry in forum C++ Programming
    Replies: 6
    Last Post: 09-11-2002, 05:00 AM