Pretty much everything is good to go except when displaying the information using a function. please let me know if there are alternatives to making the code better and cleaner.
In my opinion, you don't really want to use C Strings unless you have to.
I don't understand guys like you who are always reponding in that way! Of course he is learning pointers and arrays and C-strings, and it's very important to know all those things well!
You're constructing the fullname with no space between first and last. So if first="Charlie" and last="Brown" then fullname is "CharlieBrown". To fixthis add strcat(fullname, " "); between lines 32 and 33.
Also, your array sizes seem too small to me. Some names are quite long so I'd make them 50%-100% larger.
I notice in line 30, you use size1 when you're inputting for lastName. I guess it doesn't matter in this case since size1 and size2 have the same values, but you should still change it.
Also, remember that cstrings have a terminating '/0' character. You have to leave room for that when you're inputting.
In other words, line 30 should be cin.getline(lastName,size2 - 1);.
I don't understand guys like you who are always reponding in that way! Of course he is learning pointers and arrays and C-strings, and it's very important to know all those things well!
I think you misunderstood what i'm saying.
I agree that it's very important to know how to use C-strings, and understand how pointers/arrays work.
However, I think that in most cases it makes more sense to use strings since you aren't limited to a certain size.
I realize that you can dynamically allocate chars if you don't want to be limited to a size, but it just seems like more work for the same result to me.
However I do agree that it's very important to understand how to utilize char arrays/pointers.