diff -r ebc84c812384 -r 46218c8b8afa Symbian3/PDK/Source/GUID-6F78B032-00EC-4638-8B65-88CA99075B4F.dita --- a/Symbian3/PDK/Source/GUID-6F78B032-00EC-4638-8B65-88CA99075B4F.dita Thu Mar 11 15:24:26 2010 +0000 +++ b/Symbian3/PDK/Source/GUID-6F78B032-00EC-4638-8B65-88CA99075B4F.dita Thu Mar 11 18:02:22 2010 +0000 @@ -1,43 +1,43 @@ - - - - - -Example -using <codeph>main()</codeph> -

A simple example using main() as an entry -point is described below. The example writes a text to a file.

-
    -
  • Modify the MMP file as mentioned before.

  • -
  • Do usual C style coding.

  • -
-#include <stdio.h> -#include <string.h> - -int main(void) -{ - FILE* fd; - char* fileName = "C:\\test.txt"; - char *buf = "Hello world"; - fd = fopen(fileName, "w"); - if(fd == NULL) - { - printf("Unable to open the file (%s)", fileName); - return -1; - } - if (fwrite(buf, sizeof(char), strlen(buf), fd) < 0 ) - { - perror("write fails."); - } - printf("File (%s) is created successfully.", fileName); - fclose(fd); - getchar(); - return 0; - } + + + + + +Example +using <codeph>main()</codeph> +

A simple example using main() as an entry +point is described below. The example writes a text to a file.

+
    +
  • Modify the MMP file as mentioned before.

  • +
  • Do usual C style coding.

  • +
+#include <stdio.h> +#include <string.h> + +int main(void) +{ + FILE* fd; + char* fileName = "C:\\test.txt"; + char *buf = "Hello world"; + fd = fopen(fileName, "w"); + if(fd == NULL) + { + printf("Unable to open the file (%s)", fileName); + return -1; + } + if (fwrite(buf, sizeof(char), strlen(buf), fd) < 0 ) + { + perror("write fails."); + } + printf("File (%s) is created successfully.", fileName); + fclose(fd); + getchar(); + return 0; + }
\ No newline at end of file