Hi,
1. If the program get some char (as an argument argv[1]), and I want to use this char, can I do:
ch = (char)atoi(argv[1]);
Is this a proper use?
No. atoi is not a standard C++ function and converts a C string to an integer.
This is all you need:
ch=argv[1][0];
I'm sorry, I should have mentioned that I use C and not C++
Does it make any difference?
Cause if it converts a C string to an Integer and I want to convert it back to char, shouldn't it be aloud?
calling atoi with any non-numeric string always returns 0.