Different method to initialise string

 #include<stdio.h>


int main(){ 

    char *ptr = "Sunil Bhai";

    // char ptr[] = "Sunil ;

// We can change string with *ptr

    ptr = "Bhaskar";

    printf("%s", ptr);

    return 0;

}

Comments

Popular posts from this blog

Snake game.c

Type declaration

Array with function