converting string into integer



Hi there,

I want to convert a String into integer.

I get the string froma file using :

string argNum;
getline(inputStream,argNum);

I now need to convert argNum into integer.

I tried to use

int a = atoi(argNum);

But I got errot message :error: cannot convert `std::string' to `const
char*' for argument `1' to `int atoi(const char*)'

And for the getline function, the argNum must be a string variable.

Can anyone please tell me how to convert argNum into integer ?

Thank you in advance,
priya

.



Relevant Pages

  • Re: converting string into integer
    ... I want to convert a String into integer. ... What is this getline function you're speaking of? ... char*' for argument `1' to `int atoi' ... Can anyone please tell me how to convert argNum into integer? ...
    (comp.lang.c)
  • Re: Brian Kernighan, maybe Im not worthy, maybe Im scum
    ... conformant string. ... int repeats, reps; ... ref satisfierLength); ...
    (comp.programming)
  • RE: Controling Modal Dialogs (Solution)
    ... doesn't return until the 'modal' browser returns. ... string varOptions) ... public void DocumentComplete ... int rc = winDisp.Invoke(rgDispId, ref guid, 0, ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Gcc compatible header file
    ... A string collection is a table of zero terminated strings that will grow ... typedef struct _StringCollection StringCollection; ... int; ... bool; ...
    (comp.lang.c)
  • Kernighan and Pikes "Beautiful" Code
    ... conformant string. ... int repeats, reps; ... ref satisfierLength); ...
    (comp.programming)