By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,433 Members | 1,643 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,433 IT Pros & Developers. It's quick & easy.

how to mofify this program

P: 1
Hi friends,

I have a C++ application running on Windows. This application has a vairable be #define 'ed as
[COLOR=Navy]#define NUM_POINTS 100[/COLOR]
There is also a struct declared in the same .h file, like
[COLOR=Navy]struct PointImplementation{
int pointName;
double position[NUM_POINTS][3];
}; [/COLOR]

Now instead of hardcoded the NUM_POINTS, we need to make the applcation more flexible by deleting the macro #define NUM_POINTS 100, NUM_POINTS will get its value at the run time. What's the easiest way to modify the code to make the struct PointImplementation work?

Thanks,
and best regards,

Eileen
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


Expert Mod 100+
P: 2,328
It's been a while with C++, but wouldn't you just add

Expand|Select|Wrap|Line Numbers
  1. str NUM_POINTS;
in the struct.

Could be very wrong here, so if someone knows the answer, please post it.
Nov 18 '05 #2

Post your reply

Sign in to post your reply or Sign up for a free account.