6,741 Posted Topics

Member Avatar for TheNNS

I think this thread has gone far enough. Since we're getting into the realm of remedial hacking advice, I'm going to call an end to it.

Member Avatar for Narue
0
635
Member Avatar for cwarn23

That might alleviate the confusion about how to post a tutorial for review.

Member Avatar for cwarn23
0
517
Member Avatar for cyberguy007

Assuming by "empty" you mean if you try to read any characters, the input will fail immediately at end-of-file, then testing for an empty file is trivial: [code] #include <fstream> #include <iostream> int main() { const char *filename = "test.txt"; std::ifstream in ( filename ); if ( !in ) std::cerr<< …

Member Avatar for sanof3322
0
30K
Member Avatar for cwarn23

I'm not entirely sure I see the point of these graphs aside from the initial novelty. Keep in mind that there needs to be some sort of justification for a new feature because there's a cost to both the implementation and maintenance going forward. Since I'm reasonably sure Dani has …

Member Avatar for Dani
0
179
Member Avatar for valestrom

Define your own constructor for Form2 that accepts this information and sets control values accordingly. For example: [code] Form2^ frm = gcnew Form2("Hydrogen"); frm->ShowDialog(); [/code]

Member Avatar for triumphost
0
203
Member Avatar for vishwanath.m

[QUOTE]i just want to extract the last bit of the given variable.[/QUOTE] Which bit do you think is the "last bit"? The term is ambiguous as it could be interpreted as either the most significant bit or the least significant bit. [QUOTE]note:dont extract the bits by dividing it by 2[/QUOTE] …

Member Avatar for vishwanath.m
-1
129
Member Avatar for imolorhe

That's like asking what the possible uses of arithmetic are and applications for everyday life. Can you narrow down your question just a little?

Member Avatar for daddymummy
0
227
Member Avatar for maybnxtseasn

[QUOTE]my question is are both of these lines equivalent? or is one wrong and one right? int (*pFcn)(int, int) = Add; int (*pFcn)(int, int) = &Add;[/QUOTE] They're both correct and functionally identical. The reason why is because you can only do two things with a function: call it and take …

Member Avatar for Narue
0
80
Member Avatar for George_91

Ideally you would use the std::vector class instead of trying to manage dynamic memory and pointers.

Member Avatar for gerard4143
0
160
Member Avatar for DriftingFable

You're checking every character in the array, not every character in the string. The latter is likely to be much shorter, which means you'll be looking at a lot of indeterminate characters. However, since you're already taking the length of the string, just change this: [QUOTE][CODE] for (int i = …

Member Avatar for DriftingFable
0
478
Member Avatar for mehmedean

There's not really a comment feature for posts. You really have only two options at present: [list=1] [*]Give the post positive or negative rep with the up or down arrows, respectively. This gives you the option to include a reputation comment. [*]Reply to the thread with a quote. The easiest …

Member Avatar for Netcode
0
211
Member Avatar for gAb1

Welcome aboard. We can always use folks with C and C++ experience, those are two of the more active forums on Daniweb.

Member Avatar for Netcode
0
123
Member Avatar for valestrom

You're SOL, sorry. The Mono project supports .NET to a certain extent, but only via C# last I checked.

Member Avatar for pseudorandom21
0
169
Member Avatar for meawesome

[url]http://en.wikipedia.org/wiki/Function_(computer_science)[/url]

Member Avatar for Ancient Dragon
0
70
Member Avatar for Dani

>Well, given the number of new threads posted daily, >most don't seem to have any difficulty figuring it out. The site design has changed significantly at least once since this thread was started in 2005.

Member Avatar for happygeek
0
1K
Member Avatar for peter_budo

[QUOTE=peter_budo;1667363]@Netcode if you do not have anything constructive to discussion then please do not comment[/QUOTE] A reasoned argument against your suggestion [i]is[/i] constructive. Professionals are more likely to browse github et al. because there's a better chance of finding something. Daniweb doesn't have a lot of tutorials, which puts it …

Member Avatar for Netcode
1
299
Member Avatar for leefuren

[B]>Might the sir be needing anything else? [/B] For future reference, please be aware that email addresses in posts are against the rules and extremely likely to be removed by the moderators. If you quote the email address, that doubles the work required to clean up the mess because the …

Member Avatar for arpit56
1
532
Member Avatar for swissknife007

Your code is awful and I'm not terribly interested in making it better. Please read [URL="http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_bst1.aspx"]this tutorial[/URL] and try to match your algorithms to the sample code.

Member Avatar for swissknife007
0
256
Member Avatar for jon.kiparsky

Haha! That's far more entertaining than I thought it would be. It's a refreshing break from the usual Java applet visualizations.

Member Avatar for AliTheChamp
3
127
Member Avatar for mangopearapples

[QUOTE]Nobody Click on these links.[/QUOTE] The broken links were broken but have been fixed. The correct links are safe.

Member Avatar for AliTheChamp
0
242
Member Avatar for Uni

Without knowing the format, all I can suggest is breaking the string down into tokens where each token represents a word, a space, or a special character. Once you have a list of those tokens, you can parse them more easily according to the format's rules: [code] #include <ctype.h> #include …

Member Avatar for Uni
0
127
Member Avatar for Zssffssz
Re: Auto

[QUOTE]So is this the thing that C can do that C++ can't?[/QUOTE] Um, no? C still allows the [ICODE]auto[/ICODE] keyword as a storage class specifier, but as Mike said, it's useless to anyone but a compiler writer. As far as C doing something that C++ can't, I'd say C++'s new …

Member Avatar for Narue
0
186
Member Avatar for Ich bin würdig

[QUOTE]Can you suggest a better code for this?[/QUOTE] Yes, but given past history, I suspect you'll continue to use your current awful code style even if somebody shows you a much better alternative. Thus, I'm inclined to think that suggesting better code for you would be a waste of time.

Member Avatar for rubberman
0
237
Member Avatar for geeksforgeek

[url]http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm[/url] [url]http://floating-point-gui.de/[/url]

Member Avatar for Narue
0
144
Member Avatar for sunn shine

Use the disk you originally installed from. If you don't have it, upgrade to one of the Express versions (they're free).

Member Avatar for Narue
0
201
Member Avatar for Ich bin würdig

We're not here to fix all of your problems. Learn to debug your own code. If you have a specific problem, ask a specific question.

Member Avatar for YAMNA MIDHAT
0
190
Member Avatar for Justinedeleon
Member Avatar for adot76

Convert the character to lower case before using it as an index: [code] num[tolower(userstring[c]) - 'a']++; [/code] Note that you'll need to include <ctype.h> for tolower().

Member Avatar for Narue
0
212
Member Avatar for Leaningnew

You don't need to avoid using scanf() to read a character, though it [i]is[/i] a relatively heavy function compared to getchar().

Member Avatar for cse.avinash
0
107
Member Avatar for daianahoney

[QUOTE=daianahoney;1664740]Hello. I am wondering how to split a string lets say char *a="raining apples training away" using a delimiter like "g a" and the result will be: rainin pples trainin way I tried using strstr but I got stuck. Any hints will be greatly appreciated. Thank you in advance![/QUOTE] Assuming …

Member Avatar for daianahoney
0
3K
Member Avatar for HungMob

The first thing your inner loop does is read from the file into [ICODE]Positive_Integers[/ICODE]. However, the first number was already read to determine if it was a sentinel in the outer loop. So you're basically discarding the first number. The next number should be read [i]after[/i] the current number is …

Member Avatar for HungMob
0
191
Member Avatar for sydsine
Member Avatar for ~s.o.s~
Member Avatar for Netcode
0
132
Member Avatar for WolfShield

[QUOTE]what does it all mean for C/C++?[/QUOTE] Nothing at all. C++ will continue chugging along in the areas that it's best suited. People will continue to claim that C++ is dead or dying, and they'll continue to be wrong for the foreseeable future. People will still come up with reasons …

Member Avatar for Netcode
0
1K
Member Avatar for Leaningnew

[QUOTE]what fflush(stdin)means??[/QUOTE] It means whatever the implementation chooses it to mean. The C standard says that calling fflush() with an input stream is undefined. However, many implementations choose to make it read and discard unread input from the stream in a manner similar to this explicit loop: [code] while (getchar() …

Member Avatar for Narue
0
88
Member Avatar for CD1

Matlab likely guarantees a higher precision than C, and what you're seeing is the round-off errors creeping into the C algorithm.

Member Avatar for CD1
0
218
Member Avatar for cipherbeale

For future questions, please copy and paste the error in its entirety instead of paraphrasing. This is what the error actually says, which is different from your interpretation: [code] error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [/code] Going to the line that's specified, …

Member Avatar for Narue
0
993
Member Avatar for Panathinaikos22
Member Avatar for b3ginn3r

scanf() will only accept a valid integer using that code, and return a value other than 1 if the input string isn't a valid integer. It's your job to check the return value for success and handle errors: [code] #include <ctype.h> #include <stdio.h> void clear_stream(FILE *in) { int ch; clearerr(in); …

Member Avatar for Narue
0
11K
Member Avatar for programing

Presumably the brace mismatch at the end of out_stack_push() isn't a typo. You need one more closing brace before starting out_stack_pop().

Member Avatar for trin12345
0
178
Member Avatar for geeksforgeek

The expression is undefined and can have any result, please stop trying to analyze it.

Member Avatar for geeksforgeek
0
204
Member Avatar for HungMob

[QUOTE]No I'm not trying to do anything malicious or harmful to his computer. I'm just looking to have fun.[/QUOTE] Fake viruses tend not to go over well as pranks. I've heard stories of students suspended or expelled for benign but seemingly malicious software. My suggestion would be to take a …

Member Avatar for NetJunkie
0
6K
Member Avatar for blt007

Two hours, eh? Just out of curiosity, how long have you been working on this assignment?

Member Avatar for blt007
0
630
Member Avatar for Ich bin würdig

[B]>void FACTORIAL(int factorial=1, int N)[/B] Defaulted parameters must follow non-defaulted parameters. Though in this case I don't see any need for the first parameter. On a stylistic note, names in all caps are typically reserved for macros. Your function name would likely cause some raised eyebrows. [B]>for(y==1; y<=N; y++)[/B] == …

Member Avatar for Narue
0
107
Member Avatar for swissknife007

[QUOTE][CODE] j=n-1; while(j>=1) { item=del(tree,j,item); tree[j+1]=item; } [/CODE][/QUOTE] Where do you update [ICODE]j[/ICODE] inside of this loop?

Member Avatar for swissknife007
0
157
Member Avatar for falakistan

[URL="http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_rand.aspx"]Clicky[/URL].

Member Avatar for Narue
0
47
Member Avatar for asif49

Perhaps you should simply study the material and take assignments as they come. Professors don't generally give assignments that are far removed from previously taught material.

Member Avatar for Rashakil Fol
0
591
Member Avatar for theju112

Technically those aren't prototypes, they're old style declarations. To be proper prototypes you need to specify the parameter list (void if there are no parameters): [code] void addatbeg(void); void delete(void); void display(void); [/code] My educated guess is that's your problem. What compiler are you using?

Member Avatar for theju112
0
394
Member Avatar for Cross213

If that's the full code then you're missing definitions for all of the member functions.

Member Avatar for Cross213
0
153
Member Avatar for minimi

[QUOTE]Bump...............?[/QUOTE] Please don't bump your threads, it's inconsiderate to all of the other people who need help. [QUOTE]I can't figure out how to iterate through the LinkedList and delete all students whose birthYear is greater than 1995[/QUOTE] I fail to see the problem. Your main() function has code to iterate …

Member Avatar for Narue
0
181

The End.