There are a couple of things wrong with the following line: fd.get(A[i].VP, sizeof CMax);
First I think you need to read up on sizeof, you'll probably be surprised at the value of that call.
Next since your input file doesn't appear to be using fixed length strings get() is probably not the method you should be using. And unless your strings are being separated by something other than a space character (ie a tab character) retrieving the "whole" name may be problematic. Perhaps you should try retrieving first name and last name separately.
The main reason why I wanted to use char with fixed size was so I could then use same ammount of spaces between word and number despite the lenght of the name. I don't know how to make it with string.
The main reason why I wanted to use char with fixed size was so I could then use same ammount of spaces between word and number despite the lenght of the name.
But as you can see using a C-string doesn't help and is actually much more error prone.
To do what you want you'll probably want to combine the first and last names into a "temporary" string then print that string using one of the manipulators found in the <iomanip> include file so that all the strings print the same number of spaces.
Doesn't setw() only create raw spaces ? That would not really work since the size of names is different. What I need output to look like is: http://i.imgur.com/dp5zdR6.png.
It appears that you will either need two setw() calls, which should precede the variable, one for the first string and then another for the second string or first combine the two strings then use a single setw() call.
It appears that you will either need two setw() calls, which should precede the variable, one for the first string and then another for the second string or first combine the two strings then use a single setw() call.
Having a space between names would not make any sense, I think that.
The string (or two separate strings) still needs to have a fixed size or something like that since if I want to have same space between a word and numbers, like in the example:
Look at the left and right adjustment flags. You will probably need to use one before you print the variable and the other after you print the variable.