How to...?

This is a discussion on How to...? within the C Programming forums, part of the General Programming Boards category; How to change the string input to integer type?...

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    4

    How to...?

    How to change the string input to integer type?

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    1
    atoi() converts a string to an integer. It's in <stdlib.h>.

    Phil.

  3. #3
    Registered User
    Join Date
    Oct 2001
    Posts
    197

    Why donīt do a cast?

    Thatīs a cast:
    Code:
    int num;
    char c;
    
    scanf("%c",c);
    num=c;
    klausi
    When I close my eyes nobody can see me...

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21