This is a program that prints 5 user inputs of characters. I want to change the user input to upper case using toupper. I have tryied to place the function in all possible lines but it does not work
I also want to print the output in 2 columns....how can i do that??
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
int main (void)
{
int k,cnt;
char line[81];
char *t[5];
for (k=0; k<5; k++)
{
gets(line);
if feof(stdin) break;
t[k]=(char*) malloc(1+strlen(line));
if (t[k]==NULL)
{
printf("out of storage");
break;
}
strcpy(t[k], line);
}
cnt=k;
printf("count=%d\n",cnt);
for (k=0; k<cnt; k++)
{
printf("%d %s\n", k,t[k]);
free(t[k]);
}
return 0;
}