Multiple choice general knowledge science & technology

When using atoi( ) with an apstring variable,?

  1. you must convert the apstring to a standard string by using .c_str( ).

  2. all numbers within the string will be converted to integers.

  3. all characters within the string will be converted to ASCII equivalents.

  4. all alphabetic characters within the string will be counted.

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

When using atoi() with an apstring variable (a string class commonly used in some programming courses), you must convert the apstring to a standard C-style string using the .c_str() method. The atoi() function expects a null-terminated C-string (const char*), not a C++ string object. This conversion is necessary for the function to work correctly.