User Profile

Collapse

Profile Sidebar

Collapse
AceInfinity
AceInfinity
Last Activity: Mar 8 '16, 05:43 PM
Joined: Apr 29 '13
Location: Canada
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • AceInfinity
    replied to Problem in comparing string of integers.
    in C
    You'll have to convert the strings to integers to use those operators, or overload the operators for the strings which will do the conversion or calculate the numbers based on the characters yourself.
    See more | Go to post

    Leave a comment:


  • It is not a "find" algorithm, it's a template function in the STL assuming you're talking about the <algorithm> header. Additionally, if this was urgent why didn't you provide some code to help us out? There's no context that would allow us to help you with your issue. The operands don't match and that's about as much as we can tell you.
    See more | Go to post

    Leave a comment:


  • AceInfinity
    replied to Problem in comparing string of integers.
    in C
    Unless the > and == operators are overloaded, what exactly do you expect them to do? They are strings. What would you expect "Cat" < "Dog" to evaluate to? They are only defined for numeric value types mainly.
    See more | Go to post

    Leave a comment:


  • @maan - No, you're wrong... m+1 is not the same as m+=1. m+1 holds the value of m after m+=1, but for m+1, the value of m will still be (m+1)-1, because that added 1 is not stored in the variable m.

    edit: m=m+1 is the same as m+=1.
    See more | Go to post

    Leave a comment:


  • AceInfinity
    replied to Whats wrong
    in C
    There's nothing wrong with this code... Other than the un-used variable x. signed is implied even if you don't specify that btw.
    See more | Go to post

    Leave a comment:


  • AceInfinity
    replied to Difference between int and double???
    in C
    However different from first glance, they do have similarities. Floating point datatypes do have an integral representation. float can be thought of as single(?) floating point datatype, and double is just a double floating point datatype. Just because they have a decimal doesn't make them accurate datatypes though. Use them for approximation, not accuracy.
    See more | Go to post

    Leave a comment:


  • There's not enough information provided here, or you aren't providing all of the information needed. Ticks could mean a timer tick, or it could mean CPU ticks/cycles.
    See more | Go to post

    Leave a comment:


  • AceInfinity
    replied to Output a UTF-8 file
    How are you reading and how are you writing the file? There are constructors for Stream inherited classes that allow you to specify an encoding.
    See more | Go to post

    Leave a comment:


  • Make Keys.Up, Keys.Down AND Keys.W, Keys.S their own if statements. Right now this is just one big if statement, and only one condition can be ran at a time, so how do you expect more than one paddle to move here?

    It should be... if Keys.Up {} else if Keys.Down {}, and then if Keys.W {} else if Keys.S {}.
    See more | Go to post

    Leave a comment:


  • AceInfinity
    replied to Opening a File by using the extension?
    First() and FirstOrDefault( ) are not properties. Also whether it exists or not is irrelevent, and so is the question. I don't think you're understanding what I was trying to point out though.

    Your code here is the only thing I was basing my statement off of. There is a reason why one is called FirstOrDefault(), and the other is just called First().

    You don't take into account the default return value for FirstOrDefault( )...
    See more | Go to post
    Last edited by AceInfinity; Apr 29 '13, 10:38 AM. Reason: Added demo code

    Leave a comment:


  • The answer here would be undefined as it does depend on the application. We don't know at this point whether the credentials can be inputted via command line arguments or this is a window that pops up later in the lifetime of the application, expecting user input for the credentials.
    See more | Go to post

    Leave a comment:


  • AceInfinity
    replied to Opening a File by using the extension?
    @vijay6 - If you're going to use FirstOrDefault( ) but not check whether a result was found, then why not just use First()? Another thing about your code is that the ToString() is redundant...

    Also, @user033088, are you trying to load this file or just dynamically get the filepath? Have you tried a StreamReader?
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...