[root@ test]$ cat return10.c
#include <stdio.h>
int main(int argc, char *argv[]){
return 10;
}
[root@ test]$ perl -e 'print system("/path_to_return10")'
2560
I was expecting 10 but got 2560,why?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
See
$?in perldoc perlvar.You got 10 * 256 (return value = 10) + 0 * 128 (there was no core dump) + 0 (process wasn’t killed by signal).