Click here to Skip to main content
15,920,956 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: operator '*' Pin
bugDanny15-Sep-05 8:11
bugDanny15-Sep-05 8:11 
AnswerRe: operator '*' Pin
prasad_som15-Sep-05 18:48
prasad_som15-Sep-05 18:48 
GeneralRe: operator '*' Pin
bugDanny16-Sep-05 2:50
bugDanny16-Sep-05 2:50 
GeneralRe: operator '*' Pin
toxcct15-Sep-05 20:56
toxcct15-Sep-05 20:56 
QuestionNative vs Managed Pin
smch14-Sep-05 20:37
smch14-Sep-05 20:37 
AnswerRe: Native vs Managed Pin
Christian Graus15-Sep-05 11:33
protectorChristian Graus15-Sep-05 11:33 
Questionwhy the file is not opening? Pin
mcnu14-Sep-05 16:12
mcnu14-Sep-05 16:12 
AnswerRe: why the file is not opening? Pin
prasad_som14-Sep-05 19:40
prasad_som14-Sep-05 19:40 
use different objects for different files,
your code should look like this


#include <iostream>
#include <fstream>
#include <conio.h>
using namespace std;

int main()
{
ofstream file1; //declaring object for ofstream to write file
file1.open("country.doc");
if(file1.eof()!=0) {exit (1);}//error checking

file1<<"\nUnited States of America\n";
file1<<"United Kingdom\n";
file1<<"South Korea\n";

file1.close();//closing writing session
ofstream file11;
file11.open("capital.doc");//opening anthother file
if(file11.eof()!=0) {exit (1);}//error checking

file11<<"\nWashington\n";
file11<<"London\n";
file11<<"Seoul\n";

file11.close();//file closing from writing
const int N=80;
char line[N];

ifstream file2;//set object for ifstream class
file2.open("country.doc");//openign file
if(file2.eof()!=0) {exit (1);}//error checking
cout<<"\nContents of Country file\n";
while(file2)
{
file2.getline(line,N);
cout<<line;
}
file2.close();//file closing froom reading
ifstream file22;//set object for ifstream class
file22.open("capital.doc");//opening other file to read
if(file22.eof()!=0) {cout<<"ERROR WHILE FILE OPENIG";getch();return (1);}//error checking

cout<<"\nContents of Capital file\n";

while(file22)
{
file22.getline(line,N);
cout<<line;
}
system("pause");
file22.close();//closing

return 0;
} 

GeneralRe: why the file is not opening? Pin
mcnu15-Sep-05 4:11
mcnu15-Sep-05 4:11 
GeneralRe: why the file is not opening? Pin
Achim Klein17-Sep-05 16:28
Achim Klein17-Sep-05 16:28 
GeneralRe: why the file is not opening? Pin
mcnu17-Sep-05 17:53
mcnu17-Sep-05 17:53 
QuestionActiveX and Windows C++ Pin
ashok12314-Sep-05 11:26
ashok12314-Sep-05 11:26 
QuestionC++ classes for CSV database Pin
simplysanju14-Sep-05 5:38
simplysanju14-Sep-05 5:38 
AnswerRe: C++ classes for CSV database Pin
Christian Graus14-Sep-05 11:25
protectorChristian Graus14-Sep-05 11:25 
AnswerRe: C++ classes for CSV database Pin
da_comp_learner15-Sep-05 19:20
da_comp_learner15-Sep-05 19:20 
GeneralRe: C++ classes for CSV database Pin
simplysanju15-Sep-05 21:32
simplysanju15-Sep-05 21:32 
QuestionProgramming &quot;Language&quot; Pin
LiYS13-Sep-05 23:39
LiYS13-Sep-05 23:39 
AnswerRe: Programming &quot;Language&quot; Pin
Christian Graus14-Sep-05 11:27
protectorChristian Graus14-Sep-05 11:27 
QuestionSOAP Client - Create Instance problem - invalid pointer Pin
leventozgur13-Sep-05 22:33
leventozgur13-Sep-05 22:33 
AnswerRe: SOAP Client - Create Instance problem - invalid pointer Pin
prasad_som14-Sep-05 3:09
prasad_som14-Sep-05 3:09 
Questionwhat the hell is this and why Pin
keshava shukla13-Sep-05 19:08
keshava shukla13-Sep-05 19:08 
AnswerRe: what the hell is this and why Pin
toxcct13-Sep-05 21:09
toxcct13-Sep-05 21:09 
AnswerRe: what the hell is this and why Pin
bugDanny15-Sep-05 8:27
bugDanny15-Sep-05 8:27 
GeneralRe: what the hell is this and why Pin
keshava shukla12-Oct-05 10:26
keshava shukla12-Oct-05 10:26 
QuestionHow to write c++ prog in MSVisual Studio.net2003? Pin
mcnu13-Sep-05 6:05
mcnu13-Sep-05 6:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.