Thread: argv?

  1. #16
    Registered User
    Join Date
    Sep 2003
    Posts
    21
    Y does the program keep looping when I enter a char as a input?

    Code:
    int main()
    {
     int x;
    
     while(1)
     {
      scanf("%d", &x);
    
      switch(x)
      {
       case 1:
        printf("%d", x);
        break;
       case 2:
        printf("%d", x);
        break;
       case 3:
        printf("%d", x);
        break;
       default:
        break;
     }
     return 0;
    }

  2. #17
    Registered User
    Join Date
    Sep 2003
    Posts
    21
    Got a prob that need some advise here, if I need to store a few thousands types using struct, say each type with 3 variables x, y and z?

    How many I suppose to search for a certain type using only x and y? Tks a million in advance.
    Last edited by EeeK; 09-07-2003 at 07:57 AM.

  3. #18
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    >>Y does the program keep looping when I enter a char as a input?
    Read:
    http://faq.cprogramming.com/cgi-bin/...&id=1043284392
    http://faq.cprogramming.com/cgi-bin/...&id=1043284385

    >>How many I suppose to search for a certain type using only x and y?
    Not sure I understand you, can you rephrase please?

    >>I need to store a few thousands types using struct
    malloc is your friend.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. help getting a grib on argc and argv
    By elwad in forum C Programming
    Replies: 10
    Last Post: 05-01-2009, 10:13 AM
  2. argv
    By taurus in forum C Programming
    Replies: 15
    Last Post: 10-14-2007, 08:57 AM
  3. Using argc and argv data
    By Rad_Turnip in forum C Programming
    Replies: 4
    Last Post: 03-31-2006, 06:09 AM
  4. how do i? re: argc - argv
    By luigi40 in forum C Programming
    Replies: 2
    Last Post: 06-11-2004, 10:17 AM
  5. more argv and argc
    By Unregistered in forum C Programming
    Replies: 6
    Last Post: 09-08-2001, 11:04 PM