Posts
 
Reputation
Joined
Last Seen
Ranked #120
Strength to Increase Rep
+10
Strength to Decrease Rep
-2
96% Quality Score
Upvotes Received
253
Posts with Upvotes
194
Upvoting Members
128
Downvotes Received
12
Posts with Downvotes
12
Downvoting Members
5
48 Commented Posts
22 Endorsements
Ranked #64
Ranked #132
~297.19K People Reached
Favorite Tags
c++ x 176
c x 162
java x 65
ruby x 20
Member Avatar for deceptikon

If the user enters a number too large to fit into a long, LONG_MAX will be returned. If the user enters a number that's exactly LONG_MAX, LONG_MAX will also be returned. The first would be an error case, the second would not (in the case that `sizeof(int) == sizeof(long)` - …

Member Avatar for Salem
8
2K
Member Avatar for Iceman10284
Member Avatar for UNIQUE_PRINCE
-1
4K
Member Avatar for nitin1

> Even if you make abc global, it still doesn't work in Visual Studio 2015 Because your function is returning a *copy* of abc and that copy is a temporary object that goes out of scope at the sequence point, just as deceptikon explained. > returnValue seems to point to …

Member Avatar for AssertNull
0
3K
Member Avatar for michael_61

This has (hopefully) been answered here: http://www.dreamincode.net/forums/topic/398067-first-and-the-follow-compilers/

Member Avatar for sepp2k
0
156
Member Avatar for PCSAWICK829

What you posted does not look like source code, it looks like what you might see when you open a binary file in a text editor. Presumably you downloaded the zcode file (which is a bytecode format), not the source code. I do not think the source code of Zork …

Member Avatar for Conrad_2
0
9K
Member Avatar for Altjen_1

Note that using a different extension won't prevent people from opening the file in a text editor. It'll just stop a text editor from being the default application that will open when you double click on it in your file manager (unless the user then selects a text editor as …

Member Avatar for tinstaafl
0
1K
Member Avatar for chubbyy.putto

> <for loop> ::= for ( <expression> ; <expression>; <expression> ) <statement> All three expressions in a for-statement are optional and from C99 onwards the first one may be a variable definition instead. Also note that the assignment specifically says that `<statement>` does not include composite statements (for whatever reason), …

Member Avatar for sepp2k
0
685
Member Avatar for sciprog22

Using your first definition `account1.compareTo(account2)` will call `account2.name.compareTo(account1.name)` and using your second definition it will call `account1.name.compareTo(account2.name)`. So using the result of the comparisson will be the other way around and thus the sort order is reversed.

Member Avatar for sciprog22
0
163
Member Avatar for abdullah_8

This isn't what's causing your syntax error, but Java doesn't have a type named `sum` nor do you define one anywhere in your prorgram (unless you defined it in a different file that you didn't show), so `sum c` is a type error (both on line 7 and line 8). …

Member Avatar for abdullah_8
0
155
Member Avatar for Cory_1

The `>` operator is only defined for primitive types. To compare `Comparable` objects, use the `compateTo` method instead.

Member Avatar for JamesCherrill
0
6K
Member Avatar for MrXortex

It looks like the Ribbit class does not have a `userid=` method - presumably because you did not define one and the corresponding table does not have a `userid` column either.

Member Avatar for Taywin
0
626
Member Avatar for Siberian

Any implementation will definitely *read* everything (well some languages have some kind of "stop here" token, which causes the impelementation to stop reading at that token, but in those case the stuff after would simply not be considered part of the program at all). Even if it did decide to …

Member Avatar for Rashakil Fol
0
343
Member Avatar for Mahnoor_1

There's only a difference when you use the return value of the increment for something. So the two loops are completely equivalent.

Member Avatar for Mahnoor_1
0
279
Member Avatar for laguardian
Member Avatar for stultuske
0
210
Member Avatar for ravi_14

2147483647 is the largest number that an int can store. When you convert it to float, it becomes 2147483648.0 due to floating point accuracies. When you convert that back to int, you'd get 2147483648, except that that's too large to fit into an int. So instead you get an overflow, …

Member Avatar for sandeepjkl
0
207
Member Avatar for hadisur_rahman

> In the program Why you used 0 in return 0 ; The return value of main is the program's exit code. If it is 0, that means that the program terminated successfully. A different return value means that the program failed. This distinction matters most in shell scripts: if …

Member Avatar for sepp2k
0
280
Member Avatar for Ahmed_62

Your question seems to be missing some words. Did you mean "After returning true, does the for loop continue?" If so, the answer is no. When the return statement is reached, the control flow returns to the call site.

Member Avatar for stultuske
0
157
Member Avatar for new_developer

When you don't specify the size of an array, the size is inferred from the initializer. So when you write `int arr[] = {1,2,3}`, that's the same as `int arr[3] = {1,2,3}`. Likewise `char formula[] = {'\0'}` is the same as `char formula[1] = {'\0'}` and equivalently `char fomula[] = …

Member Avatar for Mayukh_1
0
226
Member Avatar for Ihteshamullhaq

It'd have helped us if you had described in what way the code did not behave as expected, but your problem is that you access the matrix out of bounds (the matrix can hold 2x2 items, but you're trying to store 3x3). Also you're printing "1th" and "2th" when the …

Member Avatar for basit_3
0
125
Member Avatar for niski

Syntax errors come with a line and column number as well as some indiciation of what's missing (or what's there that shouldn't be). So to find a syntax error you should look around the given line and column for anything that might fit the error message. If the message is …

Member Avatar for niski
0
221
Member Avatar for nitin1

> I am not to properly understand why, and when we have to dynamic cast. Strictly speaking, you don't ever have to use `dynamic_cast`. You *can* use `dynamic_cast` when the castee is a pointer or reference to a class that contains at least one virtual member (that's what's meant by …

Member Avatar for mike_2000_17
0
5K
Member Avatar for nitin1

If a file has never been added, it is untracked. Untracked files are not affected by anything you do with git (like switching branches). One way of looking at it is that, until you added the file, the file did not exist in any branch. Instead it existed in the …

Member Avatar for sepp2k
0
205
Member Avatar for Baalla

NP means a NTM can solve it in polynomial time (or equivelantly that a DTM can verify the result in polynomial time). Note that NP is a superset (possibly, but not necessarily, a proper superset) of P, meaning that everything in P is also in NP. A problem X being …

Member Avatar for Schol-R-LEA
0
242
Member Avatar for Aeonix

> no instance of overloaded function "System::Console::WriteLine" matches the argument list argument types are: (const std::string) I've never used C++/CLI, but it looks like `std::string` is a distinct type from `System::String` and presumably `Console::WriteLine` only works with the latter as it is a .net method and `std::string` is a C++ …

Member Avatar for Aeonix
0
23K
Member Avatar for XodoX

Whether you can parse each line individually depends on the language. I'd say in most languages, you'd need to parse the program as a whole. But yes, a simple (as in: non-JITing) interpreter generally consists of two phases: parsing and execution. > I suppose the code needs instructions on how …

Member Avatar for sepp2k
0
117
Member Avatar for Sarkurd

If you know how many elements you're going to add to the vector (or you at least have a reasonable upper bound), you can also use `reserve` to reserve the proper amount of memory up front, preventing reallocations. Then you'd have exactly one move constructor call per `push_back` and no …

Member Avatar for Sarkurd
0
279
Member Avatar for davidbr

The `controller` variable is not defined within the `counter` method. You need to either pass it as a parameter or make it a member of the object (by doing `self.controller = controller` in the constructor) and then access it as `self.controller` instead. In the future please include any error messages …

Member Avatar for sepp2k
0
218
Member Avatar for hadisur_rahman

> Is {(1,1), (2,2), (3,3)} symmetric? transitive? Yes! Yes! Obviously I'm not your grader, but I'd expect that you need to give some explanation along with your answers to get a full score. Other than that you are correct. > Why is R = {(1,2), (2,3), (1,3), (2,1)} not transitive? …

Member Avatar for sepp2k
0
156
Member Avatar for CattleOfRa

`gcc` produces a binary executable, not a shell script. To run it, type `./main.out`.

Member Avatar for sepp2k
0
190
Member Avatar for Clearner123

No a char value can not be larger than what fits inside a char. However what getchar returns does not have to be a char value. It could also be EOF. Except for the missing `&`, your `scanf` line is perfectly fine. When `scanf` reaches the end of file (or …

Member Avatar for Clearner123
0
130