Thread: Minor Problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Code:
    void main()
    Nonstandard. Read FAQ!

    Code:
    scanf( "%s", romanchar );
    Unsafe! Read scanf format specifiers better or consider using fgets.

    Code:
    counter = 0;
    Not necessary since you're initializing it to 0 in the loop anyway (though the compiler will probably remove it when compiling a release anyway).

    Code:
    sum = sum + 4;
    All these can be written as sum += (number);

    Code:
    sum = sum + 1;
    Can be written as sum++.

    Consider using proper indentation as well.
    But code in itself, however, is not faulty. It compiles fine.
    Last edited by Elysia; 11-30-2007 at 08:32 AM.

Popular pages Recent additions subscribe to a feed