cout and ofstream

My code is something like this. The problem is it only execute csis and not the cout ! if I switch order then only cout and not csis. I am new to c++, so is there something about ofstream I am missing ? or there's something strange in my function called ?



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
#include <iomanip>
#include <fstream>
#include "Zipcode.h"

using namespace std;
ofstream csis;

int main() {

csis.open("csis.txt");

csis <<someFunctionCall()<<endl;
cout <<someFunctionCall()<<endl;

csis.close();

return 0;
}

What is someFunctionCall() doing? Maybe it's terminating the program.
GOT IT....MUST RESET THE POINTER to the array...other wise the second call gets an out of range thingy..
Topic archived. No new replies allowed.