Saturday, May 8, 2021

CPP Slip 1-(b)

 

#include<stdio.h>

#include<conio.h>

class myfile

{

 FILE *fp;

char fn[MAXSIZE];

public:

 myfile(char*fname)

{

strcpy(fn,fname);

}myfile operator +(myfile);

void operator !();

void display();

};

void myfile::display()

fp=fopen(fn,"r");

char ch;

while((ch=fgetc(fp))!=EOF)

{

 cout<<ch;

}

fclose(fp);

}

void myfile::operator !()

{

 myfile f3("a.txt");

char ch;

fp=fopen(fn,"r");

f3.fp=fopen(f3.fn,"w");

while((ch=fgetcc(fp))!=EOF)

{

 if(isupper(ch))

fputc(tolower(ch),f3.fp);

else

fputc(ch,f3.fp);

}

fclose(fp);

fclose(f4.fp);

remove("b2.txt");

}


No comments:

Post a Comment

Slip 10. Write a jQuery code to make first word of each statement to bold.

  Slip 10. Write a jQuery code to make first word of each statement to bold.  <!DOCTYPE html> <html>   <head>     <scri...