You are clobbering your memory at the following line
Code:
WashInfo = 0,0,0,0,0,0,0,0,0,0,0;
Now here is what I get when I remove this line and run your program.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct LogInfo //create new name for structure
{
char DateInfo[10];
char TimeInfo[10];
char Load[25];
char WashMode[10];
char Wash[4];
char Rinse[4];
char Spin[4];
char Soak[4];
int SoakTime;
char Temperature[14];
int EstimatedTime;
}structure;
typedef structure *WashInfoPointer; //create new type (pointer to stru
cture)
WashInfoPointer WashInfo; //define a pointer to structure
main()
{
WashInfo = malloc( sizeof(structure)); //malloc and initialize values
/*WashInfo = 0,0,0,0,0,0,0,0,0,0,0; */
strcpy(WashInfo -> Load, "Small"); //Update washing details
printf("%s\n", WashInfo->Load);
return;
}
[cd@localhost oakland]$ ./killua
Small