Click here to Skip to main content
15,905,028 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: _utime problem Pin
crazydoy29-Oct-09 18:47
crazydoy29-Oct-09 18:47 
QuestionRe: _utime problem Pin
David Crow30-Oct-09 3:39
David Crow30-Oct-09 3:39 
QuestionTimerAPCProc() Not Being Called With SetWaitableTimer() Pin
Hummer209729-Oct-09 12:48
Hummer209729-Oct-09 12:48 
AnswerRe: TimerAPCProc() Not Being Called With SetWaitableTimer() Pin
Mauro Leggieri29-Oct-09 16:53
Mauro Leggieri29-Oct-09 16:53 
GeneralRe: TimerAPCProc() Not Being Called With SetWaitableTimer() Pin
Hummer209730-Oct-09 2:45
Hummer209730-Oct-09 2:45 
QuestionHow to read and write to a BINARY file? Pin
dipuks29-Oct-09 12:46
dipuks29-Oct-09 12:46 
AnswerRe: How to read and write to a BINARY file? Pin
Member 419459329-Oct-09 13:05
Member 419459329-Oct-09 13:05 
AnswerRe: How to read and write to a BINARY file? Pin
enhzflep29-Oct-09 13:06
enhzflep29-Oct-09 13:06 
#include <stdio.h>

typedef struct _myStruct
{
    int x;
    int y;
    int z;
} myStruct;

// use this main() to create the file
int main()
{
    FILE *fp;
    char *fileName = "output.dat";
    char *mode = "wb";
    myStruct theArray[10];
    int i;
    for (i=0; i<10; i++)
    {
            theArray[i].x = i;
            theArray[i].y = 10-i;
            theArray[i].z = i * (10-i);
    }
    fp = fopen(fileName, mode);
    fwrite(theArray, sizeof(struct myStruct), 10, fp);
    fclose(fp);
}


// use this main() to read the file
/*
int main()
{
    FILE *fp;
    char *fileName = "output.dat";
    char *mode = "rb";
    myStruct theArray[10]={};
    int i;
    fp = fopen(fileName, mode);
    fread(theArray, sizeof(myStruct), 10, fp);
    fclose(fp);
    for (i=0; i<10; i++)
    {
        printf("Item %d---------\n", i+1);
        printf("<%d, %d, %d>\n\n", theArray[i].x, theArray[i].y, theArray[i].z);
    }
    system("pause");
    return 0;
}
*/

GeneralRe: How to read and write to a BINARY file? Pin
dipuks29-Oct-09 15:27
dipuks29-Oct-09 15:27 
GeneralRe: How to read and write to a BINARY file? Pin
enhzflep29-Oct-09 15:53
enhzflep29-Oct-09 15:53 
AnswerRe: How to read and write to a BINARY file? Pin
David Crow29-Oct-09 17:01
David Crow29-Oct-09 17:01 
AnswerRe: How to read and write to a BINARY file? Pin
Adam Roderick J29-Oct-09 17:58
Adam Roderick J29-Oct-09 17:58 
QuestionA General Problem Pin
WindowsVsLinux29-Oct-09 8:49
WindowsVsLinux29-Oct-09 8:49 
AnswerRe: A General Problem Pin
«_Superman_»29-Oct-09 9:04
professional«_Superman_»29-Oct-09 9:04 
GeneralRe: A General Problem Pin
WindowsVsLinux29-Oct-09 18:03
WindowsVsLinux29-Oct-09 18:03 
QuestionRe: A General Problem Pin
David Crow29-Oct-09 9:30
David Crow29-Oct-09 9:30 
AnswerRe: A General Problem Pin
WindowsVsLinux29-Oct-09 18:05
WindowsVsLinux29-Oct-09 18:05 
AnswerRe: A General Problem Pin
enhzflep29-Oct-09 9:36
enhzflep29-Oct-09 9:36 
GeneralRe: A General Problem Pin
WindowsVsLinux29-Oct-09 18:08
WindowsVsLinux29-Oct-09 18:08 
GeneralRe: A General Problem Pin
Adam Roderick J29-Oct-09 18:21
Adam Roderick J29-Oct-09 18:21 
Questionpointer and switch Pin
kbury29-Oct-09 8:18
kbury29-Oct-09 8:18 
AnswerRe: pointer and switch Pin
«_Superman_»29-Oct-09 8:21
professional«_Superman_»29-Oct-09 8:21 
GeneralRe: pointer and switch Pin
kbury29-Oct-09 8:24
kbury29-Oct-09 8:24 
AnswerRe: pointer and switch Pin
CPallini29-Oct-09 10:58
mveCPallini29-Oct-09 10:58 
GeneralRe: pointer and switch Pin
kbury30-Oct-09 2:31
kbury30-Oct-09 2:31 

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.