This works, but not the way I would like. I would like to asing string costants to an array.
Code:
#include <iostream.h>
#include <stdlib.h>
#include <stdio.h>
#define M "Monday"
#define T "Tuesday"
#define W "Wednesday"
#define TH "Thursday"
#define F "Friday"
#define S "Saturday"
#define SU "Sunday"
int main()
{
struct program
{
int z1 ;
int z2 ;
} ;
program prog ;
scanf("%d", &prog.z1) ;
scanf("%d", &prog.z2) ;
printf("%s\t%d\n", M, prog.z1) ;
printf("%s\t%d\n", T, prog.z2) ;
system("PAUSE");
return 0;
}
I tryed this:
Code:
#define MAX 10
#define DAY 7
int main()
{
char week[MAX] ;
week[MAX][DAY] {"Monday",.............} ; /*all days of the week*/
}