how to convert a fin.getline() char to integer?

This is a discussion on how to convert a fin.getline() char to integer? within the C++ Programming forums, part of the General Programming Boards category; Urgent......thank you so much......

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    117

    how to convert a fin.getline() char to integer?

    Urgent......thank you so much...

  2. #2
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    Code:
    fin.getline(bufferVariable);
    atoi(bufferVariable);
    cout<<bufferVariable+1;
    //think this is how you do it...but i know for sure it's the atoi() function
    PHP and XML
    Let's talk about SAX

  3. #3
    Registered User
    Join Date
    Nov 2002
    Posts
    117
    i have add this to the program but there is error saying :" undeclared identifier".....

    do i have to include any header file?
    i have included <string.h> and <iostream.h>.

    is that enough?
    thank you !!!

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >do i have to include any header file?
    #include <cstdlib>
    or
    #include <stdlib.h> // For older compilers

    -Prelude
    My best code is written with the delete key.

  5. #5
    Registered User
    Join Date
    Nov 2002
    Posts
    117

    sorry......

    sorry......that should be <fstream.h>

  6. #6
    Registered User
    Join Date
    Nov 2002
    Posts
    117

    fixed!!!!!

    thank you so much....

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Looking for constructive criticism
    By wd_kendrick in forum C Programming
    Replies: 16
    Last Post: 05-28-2008, 10:42 AM
  2. get keyboard and mouse events
    By ratte in forum Linux Programming
    Replies: 10
    Last Post: 11-17-2007, 05:42 PM
  3. Convert integer to char..
    By sniper83 in forum C Programming
    Replies: 7
    Last Post: 07-18-2007, 02:23 PM
  4. strcat - cannot convert char to const char
    By ulillillia in forum C Programming
    Replies: 14
    Last Post: 12-07-2006, 10:00 AM
  5. convert from an integer to an unsigned char
    By Landroid in forum C Programming
    Replies: 4
    Last Post: 05-02-2005, 02:43 AM

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