Posts
 
Reputation
Joined
Last Seen
Ranked #268
Strength to Increase Rep
+8
Strength to Decrease Rep
-2
94% Quality Score
Upvotes Received
31
Posts with Upvotes
25
Upvoting Members
21
Downvotes Received
2
Posts with Downvotes
2
Downvoting Members
2
11 Commented Posts
0 Endorsements
Ranked #540
~29.3K People Reached
Favorite Forums
Favorite Tags
Member Avatar for asif49

My industry experience is not impressive and not in your industry, so take the following with a grain of salt. I once knew a developer for a major company who would often travel to deliver training lectures for corporate clients. You might research companies that offer training for their product …

Member Avatar for Wandaga1
0
342
Member Avatar for murtazamzk

Second what WaltP says, plus don't use scanf for interactive user input, check the return values of standard library functions, and use fflush(stdout) after printing a prompt that doesn't end with '\n' to make sure it gets printed. 1 is not a portable value to pass to exit(), and returning …

Member Avatar for deceptikon
1
452
Member Avatar for sneekula

> I may be mistaken but I believe you have to by *\[sic]* QT If the rest of your post is also 12 years out of date, I'm not sure why I bothered reading it. > Few would be developing VB.net apps with GUIs without using an environment that removes …

Member Avatar for Sanchixx
0
476
Member Avatar for sparsh610

> there is no problem to do backward or frontward in single linked, as long as it is only one way to go needed, is more needed is both or one ? or you just go from start agayn to that spot you need. Or depends how much back you …

Member Avatar for mike_2000_17
0
844
Member Avatar for tubby123

Ancient Dragon is correct, but I'd like to point out that there is a difference between char *str = "Test"; /* and */ char str[] = "Test"; In both cases, "Test" is a string that resides in read-only memory. In the first case, `str` is a pointer object that is …

Member Avatar for Perry31
0
101
Member Avatar for mohsin1992

I agree with pyTony, recursion seems like an odd way to solve this problem. However, you should be able to get your original version to work if you give it an array that can be modified (untested): int main(void) { char *charset="abcdefghij"; char buffer[100] = ""; recurse(buffer,charset); } When you …

Member Avatar for Trentacle
0
2K
Member Avatar for iAndrewMeyer

Which is why you should instead use array = malloc(ROWS * sizeof *array); Also don't cast the result of malloc(), it suppresses warnings and serves no useful purpose. deceptikon's solution was in every way superior.

Member Avatar for Trentacle
0
138
Member Avatar for tunisia

$x += $y means the same thing as $x = $x + y with the exception that `$x` is evaluated only once -- this would only make a difference if evaluating $x had side effects (e.g. when it's not really a variable but actually a subroutine call). You can use …

Member Avatar for Trentacle
0
119
Member Avatar for firdousahmad

I'm going to guess you meant to post something more like this: #include <stdio.h> int main(int argc, char *argv[]) { if (argc != 2) { printf("usage: %s filename", argv[0]); } else { FILE *file = fopen(argv[1], "r"); if (file == 0) { printf("Could not open file\n"); } else { int …

Member Avatar for Trentacle
0
91
Member Avatar for jemz

Schol-R-LEA has an overall good analysis. I'll comment on three points. * Everybody you ask will have a different opinion on what editor or IDE to use. Personally I use Vim but I usually recommend jEdit for newbies; it has a good user interface, available on anything Java runs on, …

Member Avatar for Lucaci Andrew
0
308
Member Avatar for firdousahmad

You didn't ask a question, so I'm assuming you want feedback. * `void main()` is a non-standard extension to the C language. Prefer `int main(void)` (or `int main(int argc, char *argv[])` when you want to use command line arguments). * `<conio.h>` is also non-standard and also very very old. Don't …

Member Avatar for abrarsyed
0
798
Member Avatar for abrarsyed

When you declare an array (or any object) within a function, the memory allocated for it has *automatic storage duration*, meaning that once the name it was declared with goes out of scope, trying to access the memory (via e.g. a persistent pointer, like you have done) results in undefined …

Member Avatar for abrarsyed
0
547
Member Avatar for pooh1234qwerty

Why do you need an array that size? How would you rewrite your program so that such a large array is not necessary?

Member Avatar for pooh1234qwerty
0
186
Member Avatar for tunisia

Nope. The first part of a 3-statement `for` clause is run only once, before the first test or the first execution of the loop body. The equivalent would be more like mytype = 500 for x in range(filearray_count): ... That said, 500 seems to be somewhat arbitrary since you don't …

Member Avatar for TrustyTony
0
211
Member Avatar for perllearner007

Nope. If you want it to do something when you run it from the command line, you need to put code in the top level of the file (not in a function). You can easily make your script behave this way, though, if you add the following code to it: …

Member Avatar for perllearner007
0
147
Member Avatar for rupes0610

This looks odd to me: foreach $line (@L1) { $line =~ s/,,,/,/g; print @L1; } Sure you want to print all of @L1 every time through that loop? As for your output, I can't tell what you expect it to do. Could you post your input and describe what you …

Member Avatar for 2teez
0
118
Member Avatar for sammoto

The question has been marked as solved, so I don't know whether you're still expecting answers... When you find yourself calling static methods from non-static methods or vice versa, it means you haven't thought about the problem enough. You actually answered your own question after a fashion, if you take …

Member Avatar for sammoto
1
408
Member Avatar for choosenalpha

Since you're not instantiating any objects of class Die, *anything* you want to use must be declared `static`. That includes all the variables that are defined directly within the class as well as the die() method. That said, you don't have code showing how you expect to use the Die …

Member Avatar for choosenalpha
1
473
Member Avatar for bufospro

Easiest C version, guaranteed. Probably won't work under Windows though. #include <stdio.h> #include <stdlib.h> char const * const lines[] = { "my %files;\n", "while(<>) {\n", " my($index) = /(\\d+)$/;\n", " $files{$index} .= $_;\n", "}\n", "for(keys %files) {\n", " open OUTPUT, '>', \"File$_.txt\";\n", " print OUTPUT $files{$_};\n", " close OUTPUT;\n", "}\n", …

Member Avatar for TrustyTony
0
176
Member Avatar for carrot_123

For values of `voltage` less than 4200, you'll always get zero. This is because of the way integer arithmetic works. [Relevant C FAQ link.](http://c-faq.com/expr/truncation1.html)

Member Avatar for TrustyTony
0
3K
Member Avatar for abrarsyed

That's certainly one *valid* way to pass multiple values to a function, but it's not *advisable*. Your proposed solution is overly complicated, which makes it hard to document, hard to read, and hard to debug. Furthermore, it seems in your case to be totally unnecessary. Since you're not doing anything …

Member Avatar for Trentacle
0
220
Member Avatar for Perry31

> I'm using VS2010 compiler. when i use as above statement it didnt give any build error. it built fine and execute fine Cool story bro. According to section 6.4.4.4 of C99, the behavior of a multi-character single-quoted constant like '50' is implementation-defined. A diagnostic is not required in this …

Member Avatar for WaltP
0
258
Member Avatar for enakta13

Do you see why the result is 0x1.9cccccp3? I don't think you can do any better than that with the standard library. Converting fractions into other bases is not a very common need (unlike integers, which are quite handy to have in base-N sometimes.) What you might do with a …

Member Avatar for enakta13
0
430
Member Avatar for nee_88
Member Avatar for jpsider

You mean like [CODE]System.out.printf("%4.2f\t%4.2f\n", var1, var2);[/CODE] Check out the Java API for PrintStream and Formatter to see details on printf.

Member Avatar for jpsider
0
127
Member Avatar for mrprassad

I think I understand why -- printf("%s\n", s) can be optimized to puts(s). That said, this is EXACTLY why you shouldn't ever rely on undefined behavior -- because it does weird things you can't predict and is affected by apparently unrelated changes in ways you can't anticipate. Any attempt to …

Member Avatar for Moschops
0
187
Member Avatar for biojet

I'm trying, but I can't figure out how your output follows from your input. Can you explain the problem more clearly?

Member Avatar for biojet
0
156
Member Avatar for sync101

atoi() has no way to recover from errors. Use strtol() as subith86 suggested. Should you actually want to test whether a character is a digit, don't perform contortions; #include <ctype.h> and use isdigit instead.

Member Avatar for WaltP
0
183
Member Avatar for coding101

Generally speaking, anywhere in C you would see a call to malloc(), in Java (or C++) you'll find the word [B]new[/B] instead. This also applies for strings, but strings are a little bit special in that there is a unique syntax for creating them (using "...") that doesn't use [B]new[/B]. …

Member Avatar for dheaven
0
236
Member Avatar for puppycrazy

[CODE]WELCOME TO FORUMS, puppycrazy WOULD YOU LIKE TO ANNOY YOUR USERS?(Y/N) : y IN THAT CASE PLEASE CONTINUE USING ALL CAPS WOULD YOU LIKE TO GET GOOD ANSWERS?(Y/N) : y IN THAT CASE PLEASE CONSIDER PROOFREADING YOUR POSTS TO ENSURE THEY MAKE SENSE. ALSO,PLEASE!AVOID>USING~WEIRD.......><....PUNCTUATION, SPACES EXIST FOR A REASON[/CODE]

Member Avatar for puppycrazy
0
337