User Profile
Collapse
-
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. -
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.Leave a comment:
-
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.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.Leave a comment:
-
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.Leave a comment:
-
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.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.Leave a comment:
-
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.Leave a comment:
-
AceInfinity replied to How do I move two graphic paddles(pong) at the same time using one keyboard in C#?in C SharpMake 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 {}.Leave a comment:
-
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( )...Leave a comment:
-
AceInfinity replied to How to programmatically start a process and enter required user name and passwordin C SharpThe 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.Leave a comment:
-
@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?Leave a comment:
No activity results to display
Show More
Leave a comment: