libchm icon

I wanted to be cool, but instead i became retard

libchm | PRO | 10/26/14 05:55:43 PM UTC | 0 ⭐ | 506 👁️ | Never ⏰ | []
C |

600 B

|

None

|

0 👍

/

0 👎

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
 
#define BUFSIZE 128
 
int main(int argc, const char* argv[])
{
    char readbuf[BUFSIZE];
    int x = 0;
 
    printf("Please Enter some rand string of char?\n");
    do {
        fgets(readbuf, BUFSIZE, stdin);
        if(strcmp(readbuf, "\n")){
            x = 1;
        } else {
            printf("Please, enter a valid string.\n");
        }
    } while(x == 0);
    printf("The lenght of your string devided by 2 is %lu,"
           " and the overall lenght is %lu.\n", strlen(readbuf)/2, strlen(readbuf));
    return 0;
}

Comments