Greetings to everybody,

I am a programming greenhorn and I would like to make a programm which will generate a number in the way that first the user will say how many digits the number should have (i.e. 10 000) and will also specify the rules for creating the number- i.e. every 0 will change to 001 and every 1 will change to 011.
(this programm will later be good for mathematical purposes to recognize some characteristics in these so-called infinite words)

As I am a just a beginner I would be very grateful for an advice about what issues of c++ programming should I first learn so I would be able to programm a programm described above, because so far I have no idea where I should start.

Thank you a lot and i hope my question makes sence.

You should start at the beginning. Learn about the different native data types available in C++. Learn about arrays, strings and lists as common containers for holding information. If the values you will use will only be digits one and zero and you want to manipulate them, then you might want to learn about bitArrays and manipulating bits with the bitwise manipulators, etc, later.

Look up, "Bitwise operators C++", then try something like this:

unsigned char a = 1;

for(int i = 255; i > 0; i--)
    a |= i;
    a ^= i - 1;

Would have an effect like this:


In Dec that's 1-255.

That should give you an ideal about bit math in C++.
You could also just simplify that with a++ \ a += 1; .
And there really isn't any-thing conventional to hold "infinite" data.

This article has been dead for over six months. Start a new discussion instead.