File_-_fopen_writefile.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include "raylib.h"
  5. int main(void)
  6. {
  7. // Initialization
  8. //--------------------------------------------------------------------------------------
  9. const int screenWidth = 800;
  10. const int screenHeight = 450;
  11. InitWindow(screenWidth, screenHeight, "raylib example.");
  12. SetTargetFPS(60); // Set our game to run at 60 frames-per-second
  13. //--------------------------------------------------------------------------------------
  14. FILE *out = fopen("doissy.txt","w");
  15. fprintf(out, "%s %s %s", "Welcome",
  16. "to", "GeeksforGeeks");
  17. fclose(out);
  18. // Main game loop
  19. while (!WindowShouldClose()) // Detect window close button or ESC key
  20. {
  21. // Update
  22. //----------------------------------------------------------------------------------
  23. //----------------------------------------------------------------------------------
  24. // Draw
  25. //----------------------------------------------------------------------------------
  26. BeginDrawing();
  27. ClearBackground(RAYWHITE);
  28. EndDrawing();
  29. //----------------------------------------------------------------------------------
  30. }
  31. // De-Initialization
  32. //--------------------------------------------------------------------------------------
  33. CloseWindow(); // Close window and OpenGL context
  34. //--------------------------------------------------------------------------------------
  35. return 0;
  36. }