Re: writing to many files
from a quick glance, it seems there are many things wrong with the code..
- you declare your array in the loop- the array is declared:
iteration 1, len 0 - illegal
iteration 2, len 1
and so on...
this is wrong. you should declare it outside the loop of whatever size you want.
-you can't do this: funcf[ct].open (funcfile+ct);
first of all, you have to have funcfile in quotes, and you can't just say '+'. you should use strcat. you also have to tell it the full name of the file. ie the extension.
that's all i have time for right now, but there are a zillino other problems that i see..
Re: writing to many files
i just tried to look for a tutorial on how to deal with strings and char * in c++ .. found this: http://cplus.about.com/od/beginnerct.../aa051202a.htm
havne't really read it.. but you could start there, and if you don't like it just search on google... there are about a billion such tutorials.. it seems you are new to c++... you really should understand how pointers adn stuff work.. it is impossible to write code if you don't.
Re: writing to many files
ok so i fied the array declaration. now about your second statement about the opening of the funcfile+ct part. it will create files that subtract a character each time from the filename. so i named it 'test' and it ouput files named 'test' 'est' 'st' and 't'. so what is the syntax i need to use to make it output the filenames properly? and yes i do need to add the extension to the end of the filename. so when i input a filename such as 'foo.f', i want it to create files named foo1.f, foo2.f and so on. im not sure how to use strcat along with the declaration of the open function for the array. would it be like funcf[ct].open (strcat("funcfile"+ct) or something? thanks for any help.
Re: writing to many files
for strcat:
http://msdn.microsoft.com/library/de...c_._mbscat.asp
char * a= new char 10;
a[0]='hi';
char * b= " sup";
strcat (a,b);
a shoudl now have "hi sup"
Quote:
it will create files that subtract a character each time from the filename. so i named it 'test' and it ouput files named 'test' 'est' 'st' and 't'.
no...
i suggest your forget about 16 files at the moment. just do what you want for a single file. then add teh rest of them... get back with code and an explanation of what you want to do in each of the files.
seriously, read something about how strings work in c++... it will really help you...