Hey I'm simply trying to store a string inside of a struct so i can call on it later in printf's. For some reason it doesn't store the string or print it. What am i doing wrong?
#include <stdio.h>
#include <string.h>
struct receipt
{
char burger_type[45];
};
struct receipt r[25];
int main()
{
r[1].burger_type == "chicken Burger";
printf("%s pls work",r[1].burger_type);
return 0;
}
Thank you too anyone who can help. Thanks
r[0].burger_type = "chicken Burger";would be the first element in the array? (arrays are zero based in C) You also know you are not storing"chicken Burger"in the array and you need to usestrcpy()to copy the string.