FAQ how do i convert a string to an integer?? (C)

This is a discussion on FAQ how do i convert a string to an integer?? (C) within the FAQ Board forums, part of the General Programming Boards category; please help. i need to convert a string (with a numeric value) to an integer. how do i do that ...

  1. #1
    Unregistered
    Guest

    how do i convert a string to an integer??

    please help.
    i need to convert a string (with a numeric value) to an integer. how do i do that in c?
    thanks a lot.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    Code:
    int i;
    char * string = "1024";
    i = atoi(string);
    printf("%d", i);
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Link List math
    By t014y in forum C Programming
    Replies: 17
    Last Post: 02-20-2009, 06:55 PM
  2. String Class
    By BKurosawa in forum C++ Programming
    Replies: 117
    Last Post: 08-09-2007, 02:02 AM
  3. convert from integer to string
    By peter_hii in forum C++ Programming
    Replies: 2
    Last Post: 04-06-2006, 10:28 AM
  4. lvp string...
    By Magma in forum C++ Programming
    Replies: 4
    Last Post: 02-27-2003, 12:03 AM
  5. please help ... to convert date to string
    By mel in forum C Programming
    Replies: 1
    Last Post: 06-12-2002, 11:26 AM

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