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

C / C++ / MFC

 
GeneralRe: searching within strings Pin
jon-802-Aug-06 10:07
professionaljon-802-Aug-06 10:07 
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 
I got this from a computer science class and it's supposed to create a file for me. I copied it directly, and it doesn't seem to work as nothing shows up in the file. What's wrong? Thanks

#include <fstream.h>
#include<iostream.h>

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);
int i;

for(i=0; i<8; i++)
{
fout.write((char*)&stdrec[i], sizeof(stdrec[i]));
cout<
AnswerRe: Why doesn't this work? Simple file I/O Pin
Zac Howland26-Jul-06 7:47
Zac Howland26-Jul-06 7:47 
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 

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.