Quote:
Originally Posted by latino_ansari
Guys i have got a program to write... can u guys help me with it???? please i am not good with c++ and i have to submit it... Please write me the program...
Q. Write a C++ program that copies a test file. In the process, reverse the case of all letters.
Please guys... Help
|
agar tereko c++ nahi aata hai toh buy a book and learn. tera college ka major change kar and dont take c++ classes. dushron se homework karneko kehna paap hai
Heres ur hint for the homework :
just a hit use r own logic

open the file using file.open
and get the string.
then for lowercase
string x = "mera HOMEWORK dushre log KArTE hai"; //MIX of upper and lower
for(int i = 0; i < 1000; i++) //check for /n in ur case
{
if(x[i] + 32 < 122) //122 is the value for "z".
{
x[i] += 32; //32 is the difference between an uppercase and its lower counterpart
}
}
For conversion to uppercase, change the if statement to
if(x - 32 > 65) // 65 is the value for "A".
and x += 32 should be changed to x -= 32