So this structure is per a class assignment, so while there are easier ways to do this, this is the way I am supposed to do it. So structure needs to remain intact. That said, I can not make this print my line.
In Geany it will say it compiled successfully, but when I go to run it in console the char string is 'u????' instead of the string. I'm fairly new to structures in C so I am not really sure what this thing is doing. I have tried using brackets to establish the length of the char array like your supposed to with C, but it would then tell me to remove them. Any help would be greatly appreciated.
#include <stdio.h>
typedef struct {
unsigned char name;
} MY_DATA;
void name (MY_DATA *n)
{
n->name = *"Kyle";
}
int main (void)
{
MY_DATA data;
name (&data);
printf ("My name is %s\n", &name);
}