wondering if...

This is a discussion on wondering if... within the C Programming forums, part of the General Programming Boards category; this is a stupid question but is there a way i could put these two else if into one else ...

  1. #1
    Unregistered
    Guest

    wondering if...

    this is a stupid question but is there a way i could put these two else if into one else if?

    Code:
    else if((strcmp(temp, "get / http/1.1")) == 0)
    	{
    		printf("\nHTTP/1.1 200 OK\n");
    		printf("Server: Xitami/2.5d4 (Win32)\n");
    		printf("Last-Modified: Fri, 18 Jan 2002\n\n");
    		first();
    	}
    
    	else if((strcmp(temp, "get http/1.1")) == 0)
    	{
    
    		printf("\nHTTP/1.1 200 OK\n");
    		printf("Server: Xitami/2.5d4 (Win32)\n");
    		printf("Last-Modified: Fri, 18 Jan 2002\n\n");
    		first();
                      }
    thanks

  2. #2
    Registered User
    Join Date
    Jul 2002
    Posts
    273

    Re: wondering if...

    Code:
    else if(((strcmp(temp, "get / http/1.1")) == 0) || 
               ((strcmp(temp, "get http/1.1")) == 0))
    	{
    		printf("\nHTTP/1.1 200 OK\n");
    		printf("Server: Xitami/2.5d4 (Win32)\n");
    		printf("Last-Modified: Fri, 18 Jan 2002\n\n");
    		first();
    	}

  3. #3
    Unregistered
    Guest
    ok cool, thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. switch/case - Just wondering
    By Snip in forum C Programming
    Replies: 3
    Last Post: 05-22-2005, 07:04 AM
  2. wondering about people here
    By moemen ahmed in forum A Brief History of Cprogramming.com
    Replies: 23
    Last Post: 07-08-2002, 09:33 PM
  3. wondering
    By xlordt in forum A Brief History of Cprogramming.com
    Replies: 35
    Last Post: 03-01-2002, 06:05 AM
  4. Just wondering
    By Unregistered in forum Windows Programming
    Replies: 0
    Last Post: 02-12-2002, 11:14 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21