Click here to Skip to main content
15,890,123 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: searching within strings Pin
Zac Howland26-Jul-06 9:13
Zac Howland26-Jul-06 9:13 
QuestionHow to write to DataBase MS Access Pin
nahitan26-Jul-06 7:28
nahitan26-Jul-06 7:28 
AnswerRe: How to write to DataBase MS Access Pin
Hamid_RT26-Jul-06 7:36
Hamid_RT26-Jul-06 7:36 
GeneralRe: How to write to DataBase MS Access Pin
nahitan26-Jul-06 8:24
nahitan26-Jul-06 8:24 
QuestionRe: How to write to DataBase MS Access Pin
David Crow26-Jul-06 8:16
David Crow26-Jul-06 8:16 
AnswerRe: How to write to DataBase MS Access Pin
led mike26-Jul-06 8:41
led mike26-Jul-06 8:41 
QuestionWhy doesn't this work? Simple file I/O Pin
liuphil126-Jul-06 7:25
liuphil126-Jul-06 7:25 
AnswerRe: Why doesn't this work? Simple file I/O Pin
Zac Howland26-Jul-06 7:47
Zac Howland26-Jul-06 7:47 
Fixed line in bold:

#include <iostream>
#include <fstream>

using namespace std;

struct rec
{
	char name[25];
	int age;
	float wt;
};

int main()
{
	rec stdrec[8] = {	{"helen", 10, 10}, 
				{"julie", 20, 20}, 
				{"lena", 30, 30},
				{"alan", 40, 40}, 
				{"annie", 50, 50},
				{"may", 60, 60}, 
				{"lee", 70, 70}, 
				{"ed", 80,80}
			};

	fstream fout("final.dat", ios::out | ios::binary);

	for(int i=0; i<8; i++)
	{
		fout.write((char*)&stdrec[i], sizeof(stdrec[i]));
		cout 	<< stdrec[i].name << "\t" 
			<< stdrec[i].age << "\t"
			<< stdrec[i].wt <<endl;
	}
	
	return 0;
}


If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week

Zac

GeneralRe: Why doesn't this work? Simple file I/O Pin
liuphil126-Jul-06 8:01
liuphil126-Jul-06 8:01 
GeneralRe: Why doesn't this work? Simple file I/O Pin
David Crow26-Jul-06 8:18
David Crow26-Jul-06 8:18 
GeneralRe: Why doesn't this work? Simple file I/O Pin
liuphil126-Jul-06 8:52
liuphil126-Jul-06 8:52 
GeneralRe: Why doesn't this work? Simple file I/O Pin
Zac Howland26-Jul-06 8:57
Zac Howland26-Jul-06 8:57 
GeneralRe: Why doesn't this work? Simple file I/O Pin
Zac Howland26-Jul-06 8:56
Zac Howland26-Jul-06 8:56 
Questionform Displaying Pin
ningthemcha26-Jul-06 6:46
ningthemcha26-Jul-06 6:46 
AnswerRe: form Displaying Pin
Chris Losinger26-Jul-06 7:04
professionalChris Losinger26-Jul-06 7:04 
AnswerRe: form Displaying Pin
David Crow26-Jul-06 7:06
David Crow26-Jul-06 7:06 
AnswerRe: form Displaying Pin
Zac Howland26-Jul-06 7:28
Zac Howland26-Jul-06 7:28 
AnswerRe: form Displaying Pin
Hamid_RT26-Jul-06 7:29
Hamid_RT26-Jul-06 7:29 
Questiondebug assertion failed Pin
identity_8526-Jul-06 5:42
identity_8526-Jul-06 5:42 
AnswerRe: debug assertion failed Pin
Hamid_RT26-Jul-06 6:05
Hamid_RT26-Jul-06 6:05 
AnswerRe: debug assertion failed Pin
Cedric Moonen26-Jul-06 6:05
Cedric Moonen26-Jul-06 6:05 
GeneralRe: debug assertion failed Pin
identity_8526-Jul-06 6:24
identity_8526-Jul-06 6:24 
GeneralRe: debug assertion failed Pin
Zac Howland26-Jul-06 6:35
Zac Howland26-Jul-06 6:35 
GeneralRe: debug assertion failed Pin
identity_8526-Jul-06 7:59
identity_8526-Jul-06 7:59 
GeneralRe: debug assertion failed Pin
David Crow26-Jul-06 8:23
David Crow26-Jul-06 8:23 

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.