I am trying to convert a string to uppercase using the toupper command. The string is read into the program via a pointer in a seperate function.
Here is the code:
#include <stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
void main ()
{
void menu (char *choice[]);
char *name[30];
int *studentnum[4];
char *address[50];
char *choice[7];
int temp;
menu(choice);
printf("%s", choice);
}
void menu (char *choice[])
{
int x=0;
printf("----------------------MENU----------------------\n");
printf(" 1. insert --> Enter data for one student\n");
printf(" 2. display --> Display complete list of\n");
printf(" students and data.\n");
printf(" 3. sort --> Sort the data in ascending\n");
printf(" order.\n");
printf("------------------------------------------------\n");
printf("Please type the corresponding command. (ex: sort): ");
scanf("%[^\n]", choice);
for (x=0; x,7; x++)
{
&choice[x]=toupper(*choice[x]);
}
}
Can someone show me where I am going wrong?