Thread: How to...?

  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