0

What does this code mean?

If (argc != 3 || !atoi(argv[2])) I don't understand what the ! Before atoi does

19th Jul 2017, 9:09 PM
bitan
bitan - avatar
7 odpowiedzi
+ 2
Hope this might help to understand : http://www.site.uottawa.ca/~lucia/courses/2131-05/labs/Lab3/CommandLineArguments.html In short that is related to command line arguments.
19th Jul 2017, 11:59 PM
Ipang
+ 1
! is the Not operator and it changes the truth value of that function called 'atoi'. Meaning, if the function 'atoi' returns a truth value of 'TRUE' then the (!) Not operator will change that 'TRUE' to 'FALSE'.
19th Jul 2017, 9:26 PM
Ghauth Christians
Ghauth Christians - avatar
0
Thanks guys really helpful
20th Jul 2017, 12:02 AM
bitan
bitan - avatar
0
! Indicates negation. Argument in if condition is boolean.
14th Aug 2017, 4:06 PM
Avatar
Avatar - avatar
0
You should solve it logically
14th Aug 2017, 4:06 PM
Avatar
Avatar - avatar
0
It will give you answer in two ways. Sometimes "TRUE" & "FALSE" OR"0"&"1"
14th Aug 2017, 4:08 PM
Avatar
Avatar - avatar