Click here to Skip to main content
15,867,308 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: the use of 'new' Pin
CPallini26-Jun-09 8:54
mveCPallini26-Jun-09 8:54 
AnswerRe: the use of 'new' Pin
Nemanja Trifunovic26-Jun-09 9:25
Nemanja Trifunovic26-Jun-09 9:25 
GeneralRe: the use of 'new' Pin
CPallini26-Jun-09 9:51
mveCPallini26-Jun-09 9:51 
GeneralRe: the use of 'new' Pin
norish26-Jun-09 16:21
norish26-Jun-09 16:21 
AnswerRe: the use of 'new' Pin
Joe Woodbury27-Jun-09 17:48
professionalJoe Woodbury27-Jun-09 17:48 
QuestionNTGraph Zoom [modified] Pin
KevinVS26-Jun-09 4:26
KevinVS26-Jun-09 4:26 
QuestionRe: NTGraph Zoom Pin
CPallini26-Jun-09 5:00
mveCPallini26-Jun-09 5:00 
Questionhow to change data of struture object in file Pin
ashish8patil26-Jun-09 4:11
ashish8patil26-Jun-09 4:11 
Hello All ,
Sorry i am posting all code ,
i this code it is writting & reading stuct data ,BUt not changing that data i want change that data



#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;

struct MyRecord {
char name[80];
double balance;
unsigned long account_num;
};

int main()
{
struct MyRecord acc;

strcpy(acc.name, "R");
acc.balance = 1.3;
acc.account_num = 34;

ofstream outbal("balance", ios::out | ios::binary);
if(!outbal) {
cout << "Cannot open file.\n";
return 1;
}

outbal.write((char *) &acc, sizeof(struct MyRecord));
outbal.close();

ifstream inbal("balance", ios::in | ios::binary);
if(!inbal) {
cout << "Cannot open file.\n";
return 1;
}

inbal.read((char *) &acc, sizeof(struct MyRecord));

cout << acc.name << endl;
cout << "Account # " << acc.account_num;
cout.precision(2);
cout.setf(ios::fixed);
cout << endl << "Balance: $" << acc.balance;

inbal.close();
return 0;
}
QuestionRe: how to change data of struture object in file Pin
David Crow26-Jun-09 4:40
David Crow26-Jun-09 4:40 
QuestionRe: how to change data of struture object in file Pin
CPallini26-Jun-09 4:56
mveCPallini26-Jun-09 4:56 
QuestionProblem using MsiGetProductInfo for retreving the product version Pin
V K 226-Jun-09 2:48
V K 226-Jun-09 2:48 
AnswerRe: Problem using MsiGetProductInfo for retreving the product version Pin
Rajesh R Subramanian26-Jun-09 3:26
professionalRajesh R Subramanian26-Jun-09 3:26 
QuestionProgram not giving desired output Pin
Razanust26-Jun-09 2:31
Razanust26-Jun-09 2:31 
AnswerRe: Program not giving desired output Pin
Rajesh R Subramanian26-Jun-09 2:37
professionalRajesh R Subramanian26-Jun-09 2:37 
AnswerRe: Program not giving desired output Pin
CPallini26-Jun-09 2:40
mveCPallini26-Jun-09 2:40 
GeneralRe: Program not giving desired output Pin
Razanust27-Jun-09 5:36
Razanust27-Jun-09 5:36 
GeneralRe: Program not giving desired output Pin
CPallini28-Jun-09 0:36
mveCPallini28-Jun-09 0:36 
QuestionHow to change structure data written in the file. in v++ Pin
ashish8patil26-Jun-09 2:12
ashish8patil26-Jun-09 2:12 
AnswerRe: How to change structure data written in the file. in v++ Pin
Rajesh R Subramanian26-Jun-09 2:14
professionalRajesh R Subramanian26-Jun-09 2:14 
JokeRe: How to change structure data written in the file. in v++ Pin
CPallini26-Jun-09 2:28
mveCPallini26-Jun-09 2:28 
GeneralRe: How to change structure data written in the file. in v++ Pin
Rajesh R Subramanian26-Jun-09 2:38
professionalRajesh R Subramanian26-Jun-09 2:38 
GeneralRe: How to change structure data written in the file. in v++ Pin
ashish8patil26-Jun-09 4:07
ashish8patil26-Jun-09 4:07 
Questionhow to open rtf file Pin
santhosh-padamatinti26-Jun-09 1:30
santhosh-padamatinti26-Jun-09 1:30 
AnswerRe: how to open rtf file Pin
Rajesh R Subramanian26-Jun-09 1:35
professionalRajesh R Subramanian26-Jun-09 1:35 
QuestionGettin the pointers of all open windows Pin
prithaa26-Jun-09 1:11
prithaa26-Jun-09 1:11 

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.