mcclane400's Profile User Rating: -----

Reputation: 5 Worker
Group:
Active Members
Active Posts:
63 (0.03 per day)
Joined:
25-March 09
Profile Views:
1,425
Last Active:
User is offline Mar 26 2013 03:09 PM
Currently:
Offline

Previous Fields

Country:
Who Cares
OS Preference:
Who Cares
Favorite Browser:
Who Cares
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
0
Icon   mcclane400 has not set their status

Posts I've Made

  1. In Topic: When did while(boolVar = true) start compiling?

    Posted 26 Mar 2013

    View Postjon.kiparsky, on 26 March 2013 - 02:55 PM, said:

    View Postmcclane400, on 26 March 2013 - 03:48 PM, said:

    View Postmacosxnerd101, on 26 March 2013 - 02:26 PM, said:

    I'm not sure I understand your strong sentiments against this particular syntax. If you don't like it, just move the assignment outside of that part of the loop.


    You don't understand my strong sentiments against this:

    while(temp = true){
    }
    
    


    Without using a break, I've created an infinite loop.


    Well, infinite loops aren't such a problem. There are going to be times when you want to simply loop, and declaring some nonce condition isn't going to be the cleanest solution.


    Absolutely, I have no problem with infinite loops. My problem is that this code would suffice for an infinite loop:

    while(true){ }
    
    


    Why create a variable just to assign it to true? The only reason I brought up this question is that several beginning CS students want to compare a Boolean value to true and write this:

    while(temp = true){ }
    
    


    Which isn't what they wanted. Several forget to put == and put = instead. For some reason, I could have sworn this didn't compile in Java but I must have been mistaken.

    In the end, my question is answered. I must be thinking of something else. Thanks for the help.
  2. In Topic: When did while(boolVar = true) start compiling?

    Posted 26 Mar 2013

    View Postmacosxnerd101, on 26 March 2013 - 02:26 PM, said:

    I'm not sure I understand your strong sentiments against this particular syntax. If you don't like it, just move the assignment outside of that part of the loop.


    You don't understand my strong sentiments against this:

    while(temp = true){
    }
    
    


    Without using a break, I've created an infinite loop. EDIT: I don't want an infinite loop here though. I'm OK with infinite loops but the goal of the condition was to check if temp == true, not assign temp to true. I didn't make that clear.
  3. In Topic: Java oddity with +=

    Posted 24 Mar 2013

    View PostFallenG, on 24 March 2013 - 07:08 PM, said:

    EDIT:
    The forums are messing up the link for some reason:
    http://docs.oracle.com/javase/specs/jls/se5.0/html/expressions.html#15.26.2
    


    Perfect, that is exactly what I was looking for and couldn't find. So, I guess a += b is not exactly the same as a = a + b. How about that... Thanks for the link.
  4. In Topic: XXXX does not name a type, header files, cpp files

    Posted 10 Oct 2012

    View Postjimblumberg, on 10 October 2012 - 07:11 PM, said:

    Quote

    The easy fix is to move my struct outside of Temp but I don't want that.

    Why not? That is the normal way of creating a class. If you don't have Node outside your class then you can't return a node from one of your functions since the Node is not known outside the class.

    Jim


    No other classes rely on that Node so I want it to be a private struct inside of Temp. I simplified the code considerably to avoid a lot of stuff that doesn't matter. Temp is really a binary search tree and Node, well, it's a Node. Nothing outside of the class cares about Node... it's only used privately inside my Temp class.

    This isn't a practical question of "how do you solve this" because I could move Node outside Temp and it works. My question is academic in spirit. I guess I'll emphasize my original question because that's all I really care about: can I write someFunc in the cpp file without changing my .h file?

My Information

Member Title:
D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private