CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Threaded View

  1. #1
    Join Date
    May 2004
    Posts
    3

    Type conversion (item in char array, to a double)

    Hello

    I'm actually writing an assignment in C for school. I am a VBA programmer so bare with me.

    I have been trying to assign an item (numerical value) in a character array to a variable (with the data type of double).

    For example, I use a scanf() to get the input "hahidi9999" or to capture things like "9999". If it is is numeric, such as 9999. I want to take the value 9999 which is stored in a character array test[0], assign it to another variable usDollars (a double), so I can then perform a mathematical calculation.

    In VB/VBA this is very easy to do with conversion functions. However, I am not as familiar with C and am having trouble finding such functions.

    I have attached a sample I've been working with (.c extension). It is driving me crazy....the compiler we are working with is a free one called Miracle C.

    Any help would be great.
    Thanks
    Heather
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured