![]() |
| ||
| Discrete solution help! Hello, I work on a problem and I want my solution to be picked from discrete numbers.( I want a value for diameter and I want it to be selected from the available diameter values) Does anyone know it can be done with C++ and how? Thanks |
| ||
| Re: Discrete solution help! I'm not sure if I understand the question correctly, but if you want a bunch of numbers which you can choose from, you could use vectors. Example: vector<int> diameters; output: numbers available: 1 5 7 |
| ||
| Re: Discrete solution help! If you have a finite number of values and they aren't going to change, you can get away with using a standard array instead of a vector. This is only if you have a static amount of values and performance is an issue. If performance doesn't matter, use a vector as suggested from niek_e since you get the perks of a dynamic array as well as information about its size and the ability to use STL algorithms with it to manipulate, copy or iterate through its contents... etc. -Alex |
| ||
| Re: Discrete solution help! You mean if you have a radius, circumference, etc. then solve it? http://www.mathopenref.com/diameter.html |
| All times are GMT -4. The time now is 6:01 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC