Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Pasting data to a file for reading

0 votes
asked Dec 31, 2018 by Ken Goodall (120 points)
This might be a simple question but i'm trying to paste some data to a blank file for processing and I can't seem to paste it. I know I have pasted things but it doesn't seem to be working at the moment.

1 Answer

0 votes
answered Jan 1, 2019 by badPAPA
check your clipboard setting,  if you are using windows then:

go to C:/windows/system32/clipboard.exe and check your setting

else if you have c or c++,  then run below code:

#include<stdio.h>

int main(){

FILE *sf, *df;

char ch;

sf = fopen("your path of source file","r");

df = fopen("your path of blank file","w");

while(1){

ch = fgetc(sf);

if(ch == EOF)

break;

fputc(ch,df);

}

return 0;

}

this will work
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...