=20 -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of Justin Richards Sent: Tuesday, June 04, 2013 12:07 PM To: Microcontroller discussion list - Public. Subject: [OT]: Circuit Cellar c souce code error challenge Circuit Cellar have a code challenge that asks contestants to determine the error in the code below. I get ... Line 5. Declares a variable that is never used (not sure if that is an erro= r per se) NOPE: Not an error Line 8. Should be i++ not ++I NOPE: both i++ and ++i work Line 9. '%s' not sure what effect the single quotes have but they look wron= g NOPE: single quotes inside double quotes are just ordinary characters Line 9. *argv[i] should be argv[i] YEP! *argv[i] is a char, but %s expects a null-terminated string like argv[i] Line 10.1. perhaps a "return" in the function main since it is declared as int. NOPE: good idea, but not strictly required 1. #include 2. 3. int main (int argc, char *argv[]) 4. {=20 5. char ch;=20 6. int i;=20 7. 8. for (i =3D 0; i < argc; ++i) { 9. printf ("Argument #%d: '%s'\n", i, *argv[i]); 10. } 11. } Justin -- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/chang= e your membership options at http://mailman.mit.edu/mailman/listinfo/piclist --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .