Hello Prince..
can you help me answer with this please..

array of student score declared as dynamic data
-declared a dynamic data array to contain the scores for 10 students.then step through the array assigning the counter as the value of the score for that array element.finally,write another for loop that displays each score.remember that you have to use pointer to access the array.you can do this in three steps:
1.)declare a pointer and allocate space for your array
int *arr,new int[size];
2.)use a for loop to step through the array (using either pointer or the subscript notation)
for(int i=0;i<size;i++)
3.)finally,use another for to display the score
for(int i=0;i<size;i++)
cout<<"score for student"<<i+1":"

NOTE: dont forget to use delete to free up space used by the array

hope you can help me with this its very important!!
thank in advance prince..

hi dear sean !

I think i have nothing to help with this question because you have done with all :-) just add the header file inclusion and enclose the code with main() thats it

have a look at this

using namespace std;
#define SIZE 10

void main()
  int counter = 0;
  int *Array = new int[SIZE];

  for( int i= 0 ; i <SIZE ; i++)
     cin>>Array[i] = i;

  for( int i = 0 ; i < SIZE ; i++)
  delete Array;

revert me in case of issues!
Thanks and Regards
Prince M. Premnath


All Answers

Answers by Expert:

Ask Experts


Prince M. Premnath


Years of research in C/C++ Will bring you all facts regarding , OOPS , SVGA , MOUSE , BIOS , IVT , Feel free to query me :-)


More than 5 years


©2016 About.com. All rights reserved.