sequence

This is a discussion on sequence within the C++ Programming forums, part of the General Programming Boards category; I can't quite comprehend the sequence when entering while loop. Code: struct node{ int data; node *next; } .... node ...

  1. #1
    Registered User
    Join Date
    Aug 2002
    Posts
    9

    sequence

    I can't quite comprehend the sequence when entering while loop.

    Code:
    struct node{
    	int data;
    	node *next;
    }
    
    
    ....
    
    node *curr, *prev;
    
    while (curr && int x > curr->next){
    	...
    	...
    }
    of curr, int x, and curr->next how are they being compared??
    Thanks

  2. #2
    btq
    btq is offline
    julie lexx... btq's Avatar
    Join Date
    Jun 2002
    Posts
    161
    hmm..this is a odd.
    You're comparing an uninitialised int with an adress..?
    basically the statment first checks that curr!=NULL and then it
    checks if an unitialized int x is bigger than the adress of the next node. This result would be very unpredictable and I can't see the point of it..what do you want to accomplish ?


    /btq
    ...viewlexx - julie lexx

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. reading a sequence
    By drag0n69 in forum C Programming
    Replies: 4
    Last Post: 03-17-2008, 04:40 PM
  2. Immediate programming help! Please!
    By xMEGANx in forum C++ Programming
    Replies: 6
    Last Post: 02-20-2008, 11:52 AM
  3. sequence
    By braddy in forum C Programming
    Replies: 2
    Last Post: 03-30-2006, 01:15 PM
  4. wsprintf and format specifiers
    By incognito in forum Windows Programming
    Replies: 2
    Last Post: 01-03-2004, 09:00 PM
  5. How do I restart a random number sequence.
    By jeffski in forum C Programming
    Replies: 6
    Last Post: 05-29-2003, 02:40 PM

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