Code:can we define string to structure variable without using strcpy? For ex: my_struct.lname="Jensen"; instead of strcpy(my_struct.lname,"Jensen");
Code:can we define string to structure variable without using strcpy? For ex: my_struct.lname="Jensen"; instead of strcpy(my_struct.lname,"Jensen");
Nope... you need to use strcpy()
C doesn't know strings. Only it's library functions do.
Code:But we can assign string to normal variables for ex: char *str="live"; char str[5]="live"; How is it? If u know please reply.
Why are you putting everything in code tag?
char str[5]="live"; // this is array initialization.
Question 6.6b