can u guess my number?

This is a discussion on can u guess my number? within the C Programming forums, part of the General Programming Boards category; Of course, a decent compiler helps you out: Code: itsme@dreams:~/C$ cat wrongop.c int main(void) { int a; if(a = 10) ...

  1. #16
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,175
    Of course, a decent compiler helps you out:
    Code:
    itsme@dreams:~/C$ cat wrongop.c
    int main(void)
    {
      int a;
    
      if(a = 10)
        ;
    
      return 0;
    }
    itsme@dreams:~/C$ gcc -Wall wrongop.c -o wrongop
    wrongop.c: In function `main':
    wrongop.c:5: warning: suggest parentheses around assignment used as truth value
    itsme@dreams:~/C$
    If you understand what you're doing, you're not learning anything.

  2. #17
    Registered User
    Join Date
    Mar 2005
    Posts
    16
    thx for the helps guys i got it to run correctly

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 6
    Last Post: 02-19-2009, 07:19 PM
  2. Issue w/ Guess My Number Program
    By mkylman in forum C++ Programming
    Replies: 5
    Last Post: 08-23-2007, 02:31 AM
  3. Random number + guessing game trouble
    By Ravens'sWrath in forum C Programming
    Replies: 16
    Last Post: 05-08-2007, 04:33 AM
  4. small problem
    By ucfmustang in forum C Programming
    Replies: 1
    Last Post: 02-10-2003, 04:55 PM
  5. Newton-Raphson number squaring method/pointers
    By inakappeh in forum C Programming
    Replies: 2
    Last Post: 08-29-2001, 12:04 PM

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