atoi
ASCII to Integer
Is what it does and that should be enough for you to formulate a full marks answer for your homework.
All these are conversion functions - atoi()-string to integer.itoa()-integer to string.gcvt()-double to string
Yes
The 'atoi' command is actually a function. It is not peculiar to Linux; it can be found in many high-level programming languages, most notably C, where it has the following signature: int atoi (const char* str); The 'atoi' name is simply a contraction of 'ASCII to integer'. That is; you use the function to convert a null-terminated ASCII string to an integer. The string argument (str) must represent some base 10 numeric symbol. That is, "42", "-1" and "3.14" are all numeric strings but the word "ten" is not. Leading whitespace is ignored by the function. There are also two other versions of the function which convert to long and float: long atol (const char* str); float atof (const char* str); To use these functions you need to include the <stdlib.h> header in C (or <cstdlib> in C++).
atoi
With the aid of a diagram,illustrate how the c plus plus compiler works?
All these are conversion functions - atoi()-string to integer.itoa()-integer to string.gcvt()-double to string
sscanf, atoi, strtol, ...
Use the atoi() or atol() function.
Converts a character to integer (if it is a numeric character)
Yes
With functions like sscanf, strtol, strtoul, atoi, atof etc.
atoi
#include <stdio.h> #include <stdlib.h> int main(int argc, char *argv){ if(argc != 3){ printf("Gimme two dimensions\n"); }else{ printf("The area is %i\n", (atoi(argv[1]) + atoi(argv[2])) << 1); } return 0; }
The 'atoi' command is actually a function. It is not peculiar to Linux; it can be found in many high-level programming languages, most notably C, where it has the following signature: int atoi (const char* str); The 'atoi' name is simply a contraction of 'ASCII to integer'. That is; you use the function to convert a null-terminated ASCII string to an integer. The string argument (str) must represent some base 10 numeric symbol. That is, "42", "-1" and "3.14" are all numeric strings but the word "ten" is not. Leading whitespace is ignored by the function. There are also two other versions of the function which convert to long and float: long atol (const char* str); float atof (const char* str); To use these functions you need to include the <stdlib.h> header in C (or <cstdlib> in C++).
atoi
It stand for Average Time On Ice.
#include"stdio.h"int main ( int argc, char *argv[ ] ){if(argc == 2)printf("Sum of Two Numbers: %d \r\n", atoi( argv[1] ) + atoi( argv[2] ) );elseprintf( "In-valid number of arguments !! \r\n" );return 0;}Regards,Lakshmi Sreekanth