Well the Contestant class contains strings of first name, last name, age, and country. At run time the user passes a input file with various commands and the info that Contestant class is supposed to hold. So I have no idea how long these strings might be.
keep also in mind that whenever u allocate (using the -new- operator) an object which has a constructor, AN INITIALIZATION is mandatory.
This is simple when u haven't defined any constructor, since then the default constructor is called. On the other hand if u defined only e.g. a 2-argument constructor u cannot use the expression u wrote at the beginning of the post, unless u define a no-argument constructor.
BOTTOM LINE IS:
Don't allocate dynamically unless you need to.
And you need to do it if you don't know (for example) number of contestors.
But even then, you could make a vector<Contestant> to store all of them
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...