AlistairMonkeyFinger
Programmer
Hi,
again, i'm going to have to excuse myself for not being a C programmer, but i'm putting together something i need using someone else's code (always fun).
I have some code that takes file and runs though it doing some conversions etc. I need to use these conversions but instead of having a file, i have the text i need converting stored in a string.
What i don't really want to do (but it should work) is write my string out to a file, get a pointer to the file and use that. Is there a better way ?
So...
Then functions are called that use Fp for instance
and some other functions that need a file pointer.
I want to use a string str instead of Fp. Is this possible, or should i write my string out to a file ?
Thanks for any advice
Alistair![[monkey] [monkey] [monkey]](/data/assets/smilies/monkey.gif)
again, i'm going to have to excuse myself for not being a C programmer, but i'm putting together something i need using someone else's code (always fun).
I have some code that takes file and runs though it doing some conversions etc. I need to use these conversions but instead of having a file, i have the text i need converting stored in a string.
What i don't really want to do (but it should work) is write my string out to a file, get a pointer to the file and use that. Is there a better way ?
So...
Code:
char *str;
FILE *Fp;
Fp = fopen("myfile.rdf", "r");
Code:
while(NULL!=fgets(line,MX_LINE,Fp))
...
I want to use a string str instead of Fp. Is this possible, or should i write my string out to a file ?
Thanks for any advice
Alistair
![[monkey] [monkey] [monkey]](/data/assets/smilies/monkey.gif)