Click here to Skip to main content
15,790,243 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to navigate between corresponding .cpp and .h file in VS2008? Pin
Sarath C24-Mar-09 4:05
Sarath C24-Mar-09 4:05 
AnswerRe: How to navigate between corresponding .cpp and .h file in VS2008? Pin
Jijo.Raj24-Mar-09 4:31
Jijo.Raj24-Mar-09 4:31 
AnswerRe: How to navigate between corresponding .cpp and .h file in VS2008? Pin
Rolf Kristensen25-Mar-09 11:33
Rolf Kristensen25-Mar-09 11:33 
QuestionDeleted File Pin
john563224-Mar-09 3:53
john563224-Mar-09 3:53 
AnswerRe: Deleted File Pin
Sarath C24-Mar-09 4:03
Sarath C24-Mar-09 4:03 
AnswerRe: Deleted File Pin
Jijo.Raj24-Mar-09 5:09
Jijo.Raj24-Mar-09 5:09 
GeneralRe: Deleted File Pin
john563225-Mar-09 2:54
john563225-Mar-09 2:54 
QuestionProblem in struct Pin
NewVC++24-Mar-09 3:40
NewVC++24-Mar-09 3:40 
Hi All

I got example of get file size from MSDN.But i have a problem to write out put in file.How to convert struct values to CString or any other solution.
Example code is here
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <errno.h>

int main( void )
{
   struct _stat buf;
   int result;
   char timebuf[26];
   char* filename = "crt_stat.c";
   errno_t err;

   // Get data associated with "crt_stat.c": 
   result = _stat( filename, &buf );

   // Check if statistics are valid: 
   if( result != 0 )
   {
      perror( "Problem getting information" );
      switch (errno)
      {
         case ENOENT:
           printf("File %s not found.\n", filename);
           break;
         case EINVAL:
           printf("Invalid parameter to _stat.\n");
           break;
         default:
           /* Should never be reached. */
           printf("Unexpected error in _stat.\n");
      }
   }
   else
   {
      // Output some of the statistics: 
      printf( "File size     : %ld\n", buf.st_size );
      printf( "Drive         : %c:\n", buf.st_dev + 'A' );
      err = ctime_s(timebuf, 26, &buf.st_mtime);
      if (err)
      {
         printf("Invalid arguments to ctime_s.");
         exit(1);
      }
      printf( "Time modified : %s", timebuf );
   }
}


How can i write it's values buf.st_size in file.
Plz help me
AnswerRe: Problem in struct Pin
Iain Clarke, Warrior Programmer24-Mar-09 3:45
Iain Clarke, Warrior Programmer24-Mar-09 3:45 
AnswerRe: Problem in struct Pin
Michael Schubert24-Mar-09 3:47
Michael Schubert24-Mar-09 3:47 
GeneralRe: Problem in struct Pin
NewVC++24-Mar-09 3:55
NewVC++24-Mar-09 3:55 
Questionhlow.. Pin
merry jermamae arcilla24-Mar-09 3:23
merry jermamae arcilla24-Mar-09 3:23 
AnswerRe: hlow.. Pin
Michael Schubert24-Mar-09 3:31
Michael Schubert24-Mar-09 3:31 
AnswerRe: hlow.. Pin
David Crow24-Mar-09 3:35
David Crow24-Mar-09 3:35 
GeneralRe: hlow.. Pin
Michael Schubert24-Mar-09 3:38
Michael Schubert24-Mar-09 3:38 
AnswerRe: hlow.. Pin
Iain Clarke, Warrior Programmer24-Mar-09 3:49
Iain Clarke, Warrior Programmer24-Mar-09 3:49 
GeneralRe: hlow.. Pin
Michael Schubert24-Mar-09 3:55
Michael Schubert24-Mar-09 3:55 
AnswerRe: hlow.. Pin
Sarath C24-Mar-09 3:57
Sarath C24-Mar-09 3:57 
AnswerRe: hlow.. Pin
CPallini24-Mar-09 4:03
mveCPallini24-Mar-09 4:03 
AnswerGet back in the Soapbox Kyle Pin
led mike24-Mar-09 5:36
led mike24-Mar-09 5:36 
AnswerRe: hlow.. Pin
Rick York24-Mar-09 12:17
mveRick York24-Mar-09 12:17 
QuestionExtendedcombobox application Pin
Rakesh524-Mar-09 3:14
Rakesh524-Mar-09 3:14 
AnswerRe: Extendedcombobox application Pin
Iain Clarke, Warrior Programmer24-Mar-09 3:50
Iain Clarke, Warrior Programmer24-Mar-09 3:50 
GeneralRe: Extendedcombobox application Pin
Rakesh524-Mar-09 4:32
Rakesh524-Mar-09 4:32 
GeneralRe: Extendedcombobox application Pin
Iain Clarke, Warrior Programmer24-Mar-09 4:54
Iain Clarke, Warrior Programmer24-Mar-09 4:54 

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.