CompuServe Messages

switch()

    16-Dec-91 16:55:49
Sb: #17827-switch()
Fm: Khalid Aldoseri 75166,2531
To: Rob Salmon 71420,471
Rob, I believe switch() doesn't support char arrays (strings) as cases. You'll have to use strcmp() or a similar string compare routine to do that. Also, *argv[1] is a pointer to the first character in argv[1], i.e. the switch() statement is only getting the first character of argv[1] into the switch. I'm sure someone will correct me if I'm wrong. 🙂 Khalid.