valgrind-uninitialized value was created

char *nametemp = new char[count+1]
count has a value 4

when i run valgrind on it, it says
'uninitialized value was created by heap allocation'
You are allocating 5 bytes that you have not yet given a value to.
Ill put the whole code here !!
i am sorry, i should have done it in the first case !
char *temp=new char[count+1]; // count has a value 4
'for' loop
{ temp[i] = c[j]; } // c is a string;
string new(temp);
Topic archived. No new replies allowed.