hi everyone, I am new to this forum and beginners to c++. I am trying to do one program but stuck in the middle of the program. so please guys i desperately need your help.
The program i am trying to do is to read two columns integer data from file and put in two arrays . first column for one array and the other. I am going to paste my program too. but when i debug the program it will say heap corruption detected. i don't have any idea and solution. i hope guys have solution for that. i am going to paste my program below. thanking you all . have a good day.
new int[] is rather meaningless and almost certainly wrong. You haven't said how large your array needs to be. If you think the maximum value of count will be less than 100, you can use:
int *a = new int[100];
or you can declare arrays:
int a[100];
If you do this, you won't need to release the memory at the end of the function, so you won't need delete [] a;