C++ Simple Problem

Hello Dear Experts,

I am stuck with my program and I am a complete newbie to programming.
Consider I have a function func1 that takes 2 parameters alpha and filename

I have the problem with filename - a bit description about the file:
1) Consists of integers with spaces within every pair like: 1 2 5 ....
2) The first integer says how much integers there will be in the file.

Now, I need to read the integers into integer array, but firstly I should assign memory - say beta*int where beta is the first integer in my txt file.

Please try to help me with code - I think it's not going to be very long.
I need your help as quick as possible.
I don't think there will be any need of the spaces. Since you are new, I should tell you that the spaces ruin some part of of the program
example :

int 1 2 4;
int 5 5 4;
//existing code will not be taken
Last edited on
┬┐so what is the problem? It seems that you figured out.
cin >> how_many_numbers;
std::vector<int> the_array(how_many_numbers);
Topic archived. No new replies allowed.