Hello,
I am declearing the Following Variable:
Code:
char *x = "C-PROGRAMMING";
char *Prog = (char *)malloc(strlen(x));
Afterwards, I only insert several letters(chars) into Prog, Leaveing The most part blank.
Except that instead of declaring the spaces as NULL, it starts to present me with hearts and lines and what not, everything except 0(NULL).
This is how I am assigning the letters to Prog:
Code:
       for(int i = 0;i<strlen(y);i++){
               for(int i1 = 0;i1<strlen(x);i1++){
                       if(x[i1] == toupper(y[i]) && x[i] != x[R_N])
                       {Prog[i1] = x[i1];}
                       // Count1++;
                       //else{Prog[i1] = 0;
                       //}
                       }
                       }
Why is this caused?
Thank you for your attention,
Thanks
Daniel