Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C - C++ Learning > switch argument...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 15 Topic 4231 of 4370
Post > Topic >>

switch arguments

by _kamsta <kamsta.exe@[EMAIL PROTECTED] > Aug 2, 2008 at 04:46 PM

can anyone tell me whats wrong in it:

#include <stdio.h>
int err_arg()
{
    printf("function axept only two kind of argumens
\n");
   return 0;
}
int main(int argc, char *argv[])
{

    printf("%d\n",argc);
    int z;
   // char z**** = "i" ;
    for (z=0; z<= argc; z++)
    {
    printf("%d    %s\n",z,argv[z]);
    }

    if (argc==2)
   {
      printf("w if\n");
      if (argv[1]=="i")
      {
       printf("i\n");
      }
      else
      {
        printf("o\n");
      }

    }else{
          err_arg();
    }
  return 0;
}

point is that i can't catch "i" argument
thanks
k
 




 15 Posts in Topic:
switch arguments
_kamsta <kamsta.exe@[E  2008-08-02 16:46:45 
Re: switch arguments
Richard Heathfield <rj  2008-08-03 00:02:40 
Re: switch arguments
"Daniel T." <  2008-08-02 20:45:13 
Re: switch arguments
Richard Heathfield <rj  2008-08-03 05:44:39 
Re: switch arguments
Barry Schwarz <schwarz  2008-08-02 22:56:45 
Re: switch arguments
Richard Heathfield <rj  2008-08-03 06:07:21 
Re: switch arguments
comeau@[EMAIL PROTECTED]   2008-08-04 18:11:56 
Re: switch arguments
Francis Glassborow <fr  2008-08-04 14:56:58 
Re: switch arguments
Barry Schwarz <schwarz  2008-08-04 12:48:18 
Re: switch arguments
"Daniel T." <  2008-08-04 19:30:58 
Re: switch arguments
_kamsta <kamsta.exe@[E  2008-08-02 18:17:47 
Re: switch arguments
"Daniel T." <  2008-08-02 21:48:25 
Re: switch arguments
_kamsta <kamsta.exe@[E  2008-08-02 19:01:55 
Re: switch arguments
Barry Schwarz <schwarz  2008-08-02 22:16:43 
Re: switch arguments
_kamsta <kamsta.exe@[E  2008-08-03 16:22:14 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 8:30:57 CST 2008.