Just wondering, how high can c++ really count? Because I made a fibonacci program, and it starts acting weird and printing negatives at about 10-11 places. With both long, and int variables? Is it impossible to count higher? If not, how?
valestrom 17 Junior Poster in Training
Recommended Answers
Jump to Postit can go as high as you need it to go. there is no limitation. even if hardware limitations are exceeded, ye' can still use a net based resource, which is limitless.
Jump to PostHere is a general progression for using large numbers:
1. use a standard variable
2. use a long variable
3. use an unsigned long variable
4. split the number is several variables
5. use a c-string buffer
6. use an aggregate data type
7. use a library or dll …
Jump to Postshort int or int for example, would be a 'standard' or most commonly used among the native c++ variables.
All 11 Replies
Clinton Portis 211 Practically a Posting Shark
valestrom 17 Junior Poster in Training
Zssffssz -4 Junior Poster
Chilton 22 Junior Poster
valestrom 17 Junior Poster in Training
Chilton 22 Junior Poster
Zssffssz -4 Junior Poster
mike_2000_17 2,669 21st Century Viking Team Colleague Featured Poster
Clinton Portis 211 Practically a Posting Shark
L7Sqr 227 Practically a Master Poster
Clinton Portis 211 Practically a Posting Shark
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.