Click here to Skip to main content
15,889,877 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generallogic of a small game Pin
tashe2-Mar-08 6:47
tashe2-Mar-08 6:47 
GeneralRe: logic of a small game Pin
m@u2-Mar-08 7:25
m@u2-Mar-08 7:25 
GeneralPls do help me out......Very urgent!!!!! Pin
harish2rock2-Mar-08 6:42
harish2rock2-Mar-08 6:42 
GeneralRe: Pls do help me out......Very urgent!!!!! Pin
Joan M2-Mar-08 9:43
professionalJoan M2-Mar-08 9:43 
GeneralRe: Pls do help me out......Very urgent!!!!! Pin
harish2rock2-Mar-08 16:33
harish2rock2-Mar-08 16:33 
GeneralRe: Pls do help me out......Very urgent!!!!! Pin
Rajesh R Subramanian2-Mar-08 19:01
professionalRajesh R Subramanian2-Mar-08 19:01 
QuestionRe: Pls do help me out......Very urgent!!!!! Pin
Rajesh R Subramanian2-Mar-08 19:02
professionalRajesh R Subramanian2-Mar-08 19:02 
GeneralRe: Pls do help me out......Very urgent!!!!! Pin
harish2rock8-Mar-08 21:07
harish2rock8-Mar-08 21:07 
Guys,

I did work out on the code and finally came with this output :

#ifndef _SAMPLEINPUT1_
#define _SAMPLEINPUT1_

/**
*File: Sampleinput1.dat
*Description: This file contains the information in block format which is as
BEGIN PANELDATA
BEGIN TITLE
Panel Method for Saras Analsis.
Run number 22.
END TITLE
END PANELDATA

**/

#include<iostream>
#include<string>
#include<fstream>

using namespace std;

int main()
{
int i;
string s1;

ifstream.in("sampleinput1.dat");
if(!in)
{
cerr<<"Unable to open file";
exit(-1);
}

while(in)
{
in.getline(s1,100,'\n');

i=s1.find("BEGIN");

i=s1.find("PANELDATA");

i=s1.find("BEGIN");

i=s1.find("TITLE");
if(i!=string::npos)
{
cout<<"TITLE is a multiline text";
while(!s1.find(END"))
{
cout<<s1;
}
}

i=s1.find("END");

i=s1.find('TITLE");
if(i!=string::npos)
{
cout<<"End of TITLE Block";
}

i=s1.find(END");

i=s1.find("PANELDATA");
if(i!=string::npos)
{
cout<<"End of PANELDATA Block";
}
}
}

in.close();
return 0;

}

#endif


Can u ppl atleast now pls tell me whether it is correct and what modifications are needed for it ?
Also, given the below data in a file,

BEGIN FLIGHTPARAMETERS
3
Mach_number (d) Flight_speed (d) num_Panels (i)
0.8 1.0 2287
END FLIGHTPARAMETERS

How to identify 3 as an integer and (d) or 0.8 as double from the file to the code i have written above ??

Hopefully, u wud help me out guys..
GeneralRe: Pls do help me out......Very urgent!!!!! Pin
harish2rock11-Mar-08 2:02
harish2rock11-Mar-08 2:02 
GeneralInnosetup and side-by-side assemblies Pin
dontknowitall2-Mar-08 3:51
dontknowitall2-Mar-08 3:51 
GeneralRe: Innosetup and side-by-side assemblies Pin
krmed2-Mar-08 7:42
krmed2-Mar-08 7:42 
GeneralRe: Innosetup and side-by-side assemblies Pin
dontknowitall2-Mar-08 8:52
dontknowitall2-Mar-08 8:52 
GeneralRe: Innosetup and side-by-side assemblies Pin
krmed3-Mar-08 0:43
krmed3-Mar-08 0:43 
GeneralRe: Innosetup and side-by-side assemblies Pin
PJ Arends2-Mar-08 22:35
professionalPJ Arends2-Mar-08 22:35 
QuestionCFileDialog Pin
Henri2-Mar-08 3:40
Henri2-Mar-08 3:40 
GeneralRe: CFileDialog Pin
Doc Lobster2-Mar-08 4:40
Doc Lobster2-Mar-08 4:40 
GeneralRe: CFileDialog Pin
Mark Salsbery2-Mar-08 7:21
Mark Salsbery2-Mar-08 7:21 
GeneralRe: CFileDialog Pin
Sameerkumar Namdeo2-Mar-08 16:15
Sameerkumar Namdeo2-Mar-08 16:15 
Generalcant create process :( Pin
david bagaturia2-Mar-08 1:24
david bagaturia2-Mar-08 1:24 
GeneralRe: cant create process :( Pin
Hamid_RT2-Mar-08 4:50
Hamid_RT2-Mar-08 4:50 
QuestionForce flush of unwritten data to USB stick? Pin
Dominik Reichl2-Mar-08 0:54
Dominik Reichl2-Mar-08 0:54 
AnswerRe: Force flush of unwritten data to USB stick? Pin
dontknowitall2-Mar-08 3:39
dontknowitall2-Mar-08 3:39 
QuestionRe: Force flush of unwritten data to USB stick? Pin
Dominik Reichl2-Mar-08 4:00
Dominik Reichl2-Mar-08 4:00 
GeneralRe: Force flush of unwritten data to USB stick? Pin
dontknowitall2-Mar-08 9:00
dontknowitall2-Mar-08 9:00 
GeneralRe: Force flush of unwritten data to USB stick? Pin
Dominik Reichl2-Mar-08 9:57
Dominik Reichl2-Mar-08 9:57 

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.