Mae C program 2ke output?

hecker_thama

Well-known member
  • Dec 27, 2022
    6,764
    6,977
    113
    මෙ මගෙ code එක , අවුල තියෙන්නෙ රන් උනාට output නැති එක

    C:
    #include <stdio.h>
    #include <string.h>
    #include <unistd.h>
    
    int main() {
        char buf[64];
        int fd;
    
        read(0, buf, 0x39);
    
        int var1 = strncmp("DRAEGER15th30n34nd0nly4dm1n15tr4t0R0fth15sp4c3cr4ft", buf, 0x37);
        printf("\n\nvar1 = %d", var1);
        printf("\nstr2 = %s", buf);
    }


    ChatGpt th ehemmai.

    C:
    #include <stdio.h>
    #include <string.h>
    #include <unistd.h>
    
    int main() {
        char buf[64];
        int fd;
    
        // Read a line of input
        if (fgets(buf, sizeof(buf), stdin) == NULL) {
            perror("Error reading input");
            return 1;
        }
    
        int var1 = strncmp("DRAEGER15th30n34nd0nly4dm1n15tr4t0R0fth15sp4c3cr4ft", buf, 0x37);
        printf("\n\nvar1 = %d", var1);
        printf("\nstr2 = %s", buf);
    
        return 0;
    }


    කිසිම අවුලක් පෙන්න නැ?
     

    topkollek

    Well-known member
  • May 22, 2014
    42,752
    1
    56,755
    113
    ┬┴┬┴┤(·_├┬┴┬┴
    2 ma weda

    1703727713213.png