Hi sanu,
First, please use code tags. The <> button under the format section just to the right of where you type in your post places code tags. Place the text of your code in between these code tags.
I notice that you haven't initialised the fileObject arrays so I am guessing that :
|
getline(readFile, fileObject1[z]);
|
probably fails.
Have you tried using a debugger?
What is the purpose of your program? I am a little confused by the variable names openFile and fileObject1. Should these be FileCounter and StringArray?
It seems to me that you have C code in your C++ file. You are using the C function getline - there is also a C++ getline which operates on streams. In any case the second parameter is the number of chars to read and you have named that variable fileObject1[] which is really confusing.
The other thing is that you should put your declarations outside the for loop.
You should also open the file outside the for loop, do the processing in the loop, then close the file outside the loop. At the moment it looks like you want to open 31 files, then I get confused as to what you want to do.
Personally, I don't use single characters as variable names - it is much more meaningful to use a word that means something and gives the reader an idea on what the variable is really for.
Can you also provide the code for vectorObject and otherObject.
Another piece of advice (It's what I do):
Before you write any code, write a load of comments descibing what steps you are going take to complete your program. This is known as an algorithm or methodology. Now write your code after each comment. The comments serve as documentation in the code and help to enable clearer thinking.
Hope this has helped
Cheers TheIdeasMan