int main(int argc, char **argv)
{
    int     i;                              // number currently being analyzed
    int     nValues;                        // number of values successfully parsed by scanf

    printf("Floating Point Inspector\n\n");
    bigOrSmallEndian();
    for (;;) {
        printf("> ");
        nValues = getNextHexInt(&i);
        printf("0x%08X\n", i);
        if (!nValues) {                     // encountered bad input
            printf("bad input\n");
            while (getchar() != '\n') ;     // flush bad line from input buffer
            continue;
        }
        printNumberData(i);
        if (i == 0)
            break;
    }
    printf("\n");
    return 0;
}
예제 #2
0
파일: a01p.c 프로젝트: ladinu/CSClasses
// do not change this function in any way
int main(int argc, char **argv)
{
    int     i;                              // number currently being analyzed
    int     nValues;                        // number of values successfully parsed by scanf

    printf("CS201 - A01p - %s\n\n", studentName);
    bigOrSmallEndian();
    for (;;) {
        if (argc == 1)                      // allow grading script to control ...
            printf("> ");                   // ... whether prompt character is printed
        nValues = getNextHexInt(&i);
        printf("0x%08X\n", i);
        if (! nValues) {                    // encountered bad input
            printf("bad input\n");
            while (getchar() != '\n') ;     // flush bad line from input buffer
            continue;
            }
        printNumberData(i);
        if (i == 0)
            break;
        }
    printf("\n");
    return 0;
}