Hi all,
I am a new user of c language and I have written a program which just first stores the char values in memory then it reads and prints. Following is the code:
This code is not compiling giving the following error message:Code:#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> int main() { int n1,i; int buff_size = 26; char * y; y = (char *)malloc(sizeof(char)*buff_size); if (y == NULL) { fprintf(stderr, "Malloc returned void pointer\n"); exit(EXIT_FAILURE); } for (i=0; i<buff_size; i++){ y[i] = (char)(i); printf('value stored is : %c \n' , y[i]); } return 0; }
what could be the problem??Code:error C2015: too many characters in constant (at the following line) printf('value stored is : %c \n' , y[i]);
Thanks