-
My Pointer is broken....
well actually im doing a linked list in C and im having trouble inputing a string into my structure
here is my code:
Code:
typedef struct
{
char *Name;
float Price;
struct MyItems * Next;
}MyItems;
this is how im inputting Name
(Current is of type MyItems)
Code:
scanf("%s",Current->Name);
this is how im outputting Name
Code:
printf("%s",Current->Name);
i would really appreciate any help
-thenexxuz
-
You should use a character array, not a character pointer to store the string.
-
thank you
i cant belive i did that!!!
-nexxuz