Strings to integer values

This is a discussion on Strings to integer values within the C Programming forums, part of the General Programming Boards category; Hi, I was wondering would anybody have any ideas on how to convert a String of text to it's integer ...

  1. #1
    Unregistered
    Guest

    Unhappy Strings to integer values

    Hi,
    I was wondering would anybody have any ideas on how to convert a String of text to it's integer value...

    for examle,
    Some_test_text

    would return...

    1692268179263013154429224729540724...
    it's accii equilvalent...

    any suggestions or ideas would be helpful
    Thanks
    Denise

  2. #2
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,825
    Code:
    #include <stdio.h>
    #include <string.h>
    
    int main(void){
      char a[] = "Some_test_text";
      int i = 0;
      int j = strlen(a);
      for(i;i<j;i++)
      {
        printf("%d",(int)a[i]);
      }
      return 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. memory issue
    By t014y in forum C Programming
    Replies: 2
    Last Post: 02-21-2009, 12:37 AM
  2. Link List math
    By t014y in forum C Programming
    Replies: 17
    Last Post: 02-20-2009, 06:55 PM
  3. Access Violation
    By Graham Aker in forum C Programming
    Replies: 100
    Last Post: 01-26-2009, 08:31 PM
  4. can't assign proper values to an array of string
    By Duo in forum C Programming
    Replies: 1
    Last Post: 04-04-2005, 07:30 AM
  5. Need some help with integer strings
    By Guti14 in forum C++ Programming
    Replies: 4
    Last Post: 08-28-2003, 02:13 PM

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