Hello Board,
I am having trouble with basic program control. I finally seem to understand structures, pointers and passing to functions. However, I need help with some program control. This program passes structure pointers to a function which then outputs to an HTML file. However the user needs to provide some text which is then passed as Text to website. The user then is prompted to change to Italics, Bold etc which is passed to function and manipulated there. I just can't comprehend how to setup menu. 1 for accepting the change 0 to not accept the change. Here is what I Have thus far (edited):
int in_response;
fflush(stdin);
printf("Please type some text for your web page and press enter");
scanf("%c",&txtinput.txt);
fflush(stdin);
while (1)
{
printf("Enter 0 if you do not want bold text.\n");
printf("Enter 1 to if you do want bold text.\n");
printf(">-->> ");
scanf("%d",&in_response);
/* if user inputs 1 continue to utility if the
user enters 0 exit the program */
if (in_response == 1) &txtinput.bold;
if (in_response == 0) exit(0);
}
fflush(stdin);
while (1)
{
printf("Enter 0 if you do not want italics text.\n");
printf("Enter 1 to if you do want italics text.\n");
printf(">-->> ");
scanf("%d",&in_response);
/* if user inputs 1 continue to utility if the
user enters 0 exit the program */
if (in_response == 1) &txtinput.italics;
if (in_response == 0) exit(0);
}