hi,
when i display my array of charecter it displays the massage inside it
and some junk values were i have sepecified the size of the array and what
it displays is beyond the size.
please is there any one that can tell me what can be the problem,
this is the code in case
char m[100];
int size;
input.getline(m, 100, '\n');
size= strlen(m);
cout<<m<<endl;
int empty=10-(size%10);// get number of pits to be padded
constint newSize=empty+size;
char *newFrams =NULL;
newFrams=newchar[newSize];
if(empty!=0 && empty!=10) //do the padding
for(int i=size;i<(empty+size);i++)
m[i]='0';
// create new array of Frames
for(int x=0;x<newSize;x++)
{ newFrams[x]=m[x];
cout<<" the data in the index "<< x <<" is " <<newFrams[x]<<endl;
}
//update the values after padding
int Fnums=(newSize)/(10);
cout<<endl<< " the mssage is "<<newFrams<<"omima omima omima "<<endl;
cout<< " the size of the new mssage is ;" << newSize;
cout<<" the number of frames to be cheacked are "<<Fnums;
input.close();