hi there people i was hoping i could get some help please as im kinda stuck. ive have been asked for my uni portfolio to
"accept the characters from a data file rather than from the keyboard. Extend the program to convert all the characters to upper case (excluding numeric characters) and save the characters to a new data file."
at the moment i have managed to copy the file and save it to a new file but i am having trouble converting the info into uppercase can anyone help me please??
here is my code atm
#include <stdafx.h>
#include <ctype.h>
#include <cstdio>
int _tmain(int argc, _TCHAR* argv[])
{
int ch;
int user;
FILE *pt;
FILE *upper;
pt = fopen( "portfolio2.txt", "r" );
upper = fopen( "upper.txt", "w" );
printf("Do You Want To Convert Characters To Uppercase \nPlease Enter 1 For Yes 0 For No\n");
scanf("%d",&user);
if (user == 1)
{
ch = getc(pt);
while(ch != EOF)
{
putc(ch, upper);
ch = getc(pt);
}
}
fclose(pt);
fclose(upper);
return 0;
}
thanks in advance