Author
Topic: My everyday C++ learning notes (Read 6170 times)

The purpose of this thread is to share with NeoSource users 'some' notes about what I learn from C++ coding, and discus different point of views (with those who like to participate here).

btw, I will not post rated material, so I assume that the reader know at least a little about C++, if you don't understand something please let me know so I can help you too . Everything here is written by me and if I use coding from another site I will let it know very clear where it comes from.

I will start with something useful when declaring variables of different types...

:: Making life easier with Arrays

When declaring variables you have various alternatives, for example, you have 10 documents and you plan to save the document titles into different variables for use later in some part of your application / program, well in that case you can simply do this two things to declare variables :

Man, ...that coding looks nasty , lets bring Arrays right now to our application before this convert into a war zone . Ok, so I will describe arrays in my own way, they are very similar to normal variables but with only one declaration you can save looooot of typing, why?, well it stores data values into different elements, you can specify how much elements it will have like this (lets use 10 elements for our 10 document titles):

The titles of the documents are obtained by simply adding the values directly into the array right now, but I will show you how we can get them from another array that could be declared in other place and with more data different than the last one, in that case we just handle the array contents specifying the element number, check it out:

We have the titles coming from an array called 'Title' that have 10 elements.

So that ends my C++ Learning notes for today ^^, if you have anything to comment or share Ill be happy to read ^^

I attached a example .cpp file that can be compiled to test what I was doing here (If you have Visual Studio you can compile it from the Visual Studio command prompt located on Tools, write 'c:\***yourpath***\cl easyarrays_01.cpp' and press enter)