|
| CD4 (28) | |||
Hello... is there anything wrong with the code.When i give ./(programname) -h there is no output.. regards | |||
| Seph (2) | |
| Hello !! The problem is the line 7 => while (opt=getopt(argc,argv,":hw:ra")!=-1) The = ( atribution operator ) have a lower precedence than the != ( diferent operator ), in other words, your code on this line, is avaliable in this form => while ( opt = ( getopt(argc,argv,":hw:ra") ) != -1 ). As you see, the getopt function are compared with the "-1" before the opt variable get the value. To fix the problem, just put the parentheses on the right place. while ( ( opt = getopt(argc, argv, ":hw:ra") ) != - 1 ) I make a test here, using the parentheses of this form and the program run without any problems. | |
| CD4 (28) | |
| ok.. die to this the problem was occouring.. thanks for helping me :-) regards | |
This topic is archived - New replies not allowed.
