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
~293.95K People Reached
Favorite Tags
c++ x 176
c x 162
java x 64
ruby x 20
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
162
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
154
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
269
Member Avatar for laguardian
Member Avatar for stultuske
0
209
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
206
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
277
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
124
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
211
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
204
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
241
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
277
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
209
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
155
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
Member Avatar for zxz

You need to `#include <stdio.h>` to get the declaration of `fopen`. As it is now you're implicitly declaring `fopen` in a way that is incompatible with its definition. You should be getting a warning about that (and in C99 and later you should instead be getting an error that you're …

Member Avatar for zxz
0
3K