瀏覽代碼

Create Beginners_-_SetClipboard_mergeintegers.c

Rudy Boudewijn van Etten 5 年之前
父節點
當前提交
93d7687fb6
共有 1 個文件被更改,包括 60 次插入0 次删除
  1. 60 0
      Beginners_-_SetClipboard_mergeintegers.c

+ 60 - 0
Beginners_-_SetClipboard_mergeintegers.c

@@ -0,0 +1,60 @@
+
+#include "raylib.h"
+#include <string.h>
+
+int main(void)
+{
+    // Initialization
+    //--------------------------------------------------------------------------------------
+    const int screenWidth = 800;
+    const int screenHeight = 450;
+
+    InitWindow(screenWidth, screenHeight, "raylib example.");
+ 
+    SetTargetFPS(60);               // Set our game to run at 60 frames-per-second
+    //--------------------------------------------------------------------------------------
+    
+    
+    char output1[16] = "Test1";
+    int i = 247593;
+    char output2[10];
+    // put int into output2
+    sprintf(output2, "%d", i);    
+    // Put output2 behind output1
+    strcat(output1,output2);    
+    
+    // Copy results to clipboard.
+    SetClipboardText(output1);
+    
+    
+    
+
+    // Main game loop
+    while (!WindowShouldClose())    // Detect window close button or ESC key
+    {
+        // Update
+        //----------------------------------------------------------------------------------
+        
+        
+        //----------------------------------------------------------------------------------
+        // Draw
+        //----------------------------------------------------------------------------------
+        BeginDrawing();
+
+            ClearBackground(RAYWHITE);
+
+            DrawText("Check your clipboard buffer CTRL+V",50,100,20,DARKGRAY);
+
+        EndDrawing();
+        //----------------------------------------------------------------------------------
+    }
+
+    // De-Initialization
+    //--------------------------------------------------------------------------------------
+    CloseWindow();        // Close window and OpenGL context
+    //--------------------------------------------------------------------------------------
+
+    return 0;
+
+
+}