User Profile

Collapse

Profile Sidebar

Collapse
echoking
echoking
Last Activity: Aug 6 '06, 10:42 PM
Joined: Aug 5 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • echoking
    replied to variable array size (constant problem)
    in C
    Thank you for your response. The workaround that I figured was to set a constant high enough that it would be unlikely (yes I know....) that the user would ever use that variable. I then set my count variable to the size determined by user input. So I'm wasting memory, but it worked. I like your suggestion better as it seems more efficient. This program is for my final in an intro to c++ class. Thanks again!

    Joshua
    See more | Go to post

    Leave a comment:


  • echoking
    replied to variable array size (constant problem)
    in C
    After looking at my question I noticed that I wasn't being clear enough. I want to define array size with the input integer. Sorry bout that.
    See more | Go to post

    Leave a comment:


  • echoking
    started a topic variable array size (constant problem)
    in C

    variable array size (constant problem)

    I have a program that asks a user for a integer. This integer is a member of a struct statement. Later on in the program a function points to this structure in hopes of using the integer as a variable in an array. The problem that I'm seeing is that the complier, and likely the c++ coding standard, is looking for a constant to be decalared at compile. Am I thinking in the wrong way? I want to make an array that depends on the size of the input....
    See more | Go to post
No activity results to display
Show More
Working...