5,676 Posted Topics

Member Avatar for zeppelyn

The number of compares in a real bubble sort is the Summation of N, N=0 to n-1. What is 1+2+3...+19? Yours on the other hand is (20\*20)-1 I believe. So you might want to loop up how a real buble sort is defined and correct yours.

Member Avatar for WaltP
0
197
Member Avatar for Manojpandey96

Finish A and B to output the SPACEs on each line. Then the solution is obvious.

Member Avatar for Despairy
0
132
Member Avatar for abrarsyed

Care to give us specifics about the problem? With the explanation you gave, the best answer is "*then you did something wrong*".

Member Avatar for Despairy
0
171
Member Avatar for samohtvii

Probably. Compile as a C program and fix the errors. That's the simplest technique.

Member Avatar for deceptikon
0
306
Member Avatar for Lienordni

> and I would like you to answer with a code or function which would work on that compiler... Of course you would. That way you get us to do your work for you. Maybe you should read the Member Rules.

Member Avatar for Suzie999
-1
303
Member Avatar for Kryptonitex

> Your indentation could be cleaned up but thats more of a style thing. Actually, your indentation **needs** to be cleaned up. It's a readability thing. You need to be consistent. [See this](http://www.gidnetwork.com/b-38.html)

Member Avatar for Kryptonitex
0
227
Member Avatar for hchikutu
Member Avatar for ncis_sg1

Then your file is not where the program can find it. You are not testing for errors. If the program can't find the file, you ignore the error and read it anyway. Look up the file methods again and add error conditions with worthwhile messages.

Member Avatar for ncis_sg1
2
2K
Member Avatar for Sanjam.kumar

Output values to see what is happening while the program runs. This can also pinpoint where the error is and what variables have bad values.

Member Avatar for WaltP
0
345
Member Avatar for Mike Askew

Possibilities: 1) Change the message color to RED to make it more visible. If you can, change the background of the message to YELLOW to make it pop visually. 2) Add a button that must be pressed to get to the message box to override. Maybe add the hated "*are …

Member Avatar for Mike Askew
0
167
Member Avatar for chandnigandhi

Sure. [Try This](http://lmgtfy.com/?q=chat+application+in+c+language)

Member Avatar for I_m_rude
0
220
Member Avatar for Dani

Can another **Mark** link be added to the top next to the RSS icon? It's rare many of us scroll below half a page.

Member Avatar for Dani
1
226
Member Avatar for samohtvii

> I thought I could say node1->left = &node2; // left = the address of node 2. > > Is that right? What happened when you tried it? Didn't it work? And what **The Dragon** said is true. Make a pointer named `head` that will point to the first node. …

Member Avatar for WaltP
0
173
Member Avatar for DeHF

> And atlast there is no ending brace after return 0 (line 68) and no ' ; 'after return 0. [Proper formatting](http://www.gidnetwork.com/b-38.html) would have shown you this error in seconds.

Member Avatar for WaltP
0
316
Member Avatar for triumphost

I don't understand. The checksum lets you know if the pix are identical. 1) Identical pix have the same checksum. 2) Different pix have different checksums. 3) Different alpha values produce different pix, therefore different checksums. 4) Same alpha values on different pix do not produce same checksum (pix are …

Member Avatar for WaltP
0
164
Member Avatar for waqas94

> I would have to politely disagree with phorce. Bubblesort would change the indexes of the elements which would prevent you from returning the index of the smallest value (a requirement). Not if you do it correctly. But that's probably beyond the OP scope of knowlwdge. But, sorting is definitely …

Member Avatar for WaltP
0
118
Member Avatar for andreasen12N

FYI, `char cPass;` defines one character. There is no way you can cram "*correct*" into one character.

Member Avatar for np complete
0
120
Member Avatar for samohtvii

You have to somehow label the nodes: 1 Does it have 4 legs? initial (1st) question 21Y Does it purr? 2nd level Yes 31Y Cat 3rd level Yes 31N Dog 3rd level No 22Y Does it swim? 2nd level No 32Y fish 3rd level Yes 32N 3rd level No Something …

Member Avatar for samohtvii
0
3K
Member Avatar for inthiran115

What happens when you sit at your desk with the code, pencil, and paper and actually follow the program line by line? Writing the variable values as they change?

Member Avatar for Despairy
0
85
Member Avatar for inthiran115

> at the void combine 437 lines and you can't be more specific than that? > also at the part void add which precisely at combine(temp,"") Meaning what? and where? If you notice there are line numbers in your post. They might be useful.

Member Avatar for np complete
0
277
Member Avatar for LastMitch

Unfortunately, the one entry on the bar I used to use is missing -- The Favorite Forum links.

Member Avatar for LastMitch
0
243
Member Avatar for breezeonhold

How much space has been reserved for `char a[] = "Woozle";`?? In total? So will it actually fit into `char c[5];`? How much space for `char b[] = "Heffalump";` So will it actually fit into `char c[5];` too?

Member Avatar for m4ster_r0shi
0
144
Member Avatar for vaayaa1

> So if you changed your code to say (++a)++, your code would work in C++, but not in C. No it won't. Pre- **and** post- incrementing the same value is called undefined behavior, therefore the result may be different on different compilers. The result is ambiguous. [See this](http://c-faq.com/expr/evalorder2.html)

Member Avatar for WaltP
0
124
Member Avatar for samohtvii

**Jason**, Since this is the C forum, why all the C++ suggestions? Steer him correctly to C solutions.

Member Avatar for Ancient Dragon
0
803
Member Avatar for rfrapp

Set up an array with the values 1-MAX (array[MAX], MAX being 60) set up a loop with index 1 to 20 get random number from 0 to MAX-index use that number as index into array to store the next number loop from MAX-index to MAX-2 and shuffle all contents down …

Member Avatar for RainbowMatrix
0
2K
Member Avatar for PinoyDev

Look at each character and convert to decimal. Easy peasy. `strtoul()` will take time and testing to understand, you can convert this by hand in 10 minutes.

Member Avatar for WaltP
0
322
Member Avatar for Vish0203

You need to look up what `perror()` actually does. It's not in the wrong place, you're just not using it for the purpose it was intended. Also, don't use `conio.h` and `getch()`. They are non-standard and will cause you headaches when you get to the other 98% of the compilers …

Member Avatar for Vish0203
0
155
Member Avatar for np complete

With 10 pages of posts here on DaniWeb alone, I'm sure you can find the answer using SEARCH.

Member Avatar for iamthwee
0
420
Member Avatar for Despairy
Member Avatar for raistie_1
Member Avatar for coolikedat99

You are generating the random number correctly, just not *using* it correctly. 1) You don't need all that preamble to set up *seconds* and call `srand()`. It's easier (and less confusing) if you simply replace lines 10-12 with `srand(time(NULL))`. Generating *seconds* is obviously confusing you. 2) You *output* a random …

Member Avatar for RainbowMatrix
0
295
Member Avatar for I_m_rude

Enter it into a temporary input buffer. Then move it into place in your array. > **np complete:** you can handle such number by linked list. Major overkill. Since the numbers must be kept sequential, why do you need a structure containing and **int** and a **pointer** and all that …

Member Avatar for delta_frost
0
118
Member Avatar for streetalex310

>You can easily do it yourself. Just look up those hex numbers in any ascii chart >> i dont know how :( Follow his link and figure it out. It's simple.

Member Avatar for WaltP
0
163
Member Avatar for I_m_rude

No, the compiler doesn't know. You told the compiler that the variable was defined somewhere else. That's all the compiler knows. It trusts you. Its when you try to link the declaration with a definition that the linker finds your error.

Member Avatar for deceptikon
0
131
Member Avatar for kris222
Member Avatar for zeroliken
0
87
Member Avatar for Hyperion101
Member Avatar for maurya10

> At point 1 string str is "model" How do you know it's not "model\n" or "model "? Neither of those will match "model". For that matter, how do you really know *what* is in **str**?

Member Avatar for maurya10
0
282
Member Avatar for soapy.thomas

**@np complete** What your idea does is make sure there is a decimal portion to the number. But 5.0 is a valid floating point number. What the OP need to do is basically what **NathanOliver** describes. > I'm new to C++ (bet you guys don't hear that very often!!) Nope. …

Member Avatar for m4ster_r0shi
0
400
Member Avatar for ax33m144

> This looks like a homework question, and a fairly specific one at that. It looks like something from a programming intro course/tutorial, not an algorithms course. Probably very true, but we have a long-standing guideline that when you simply post requirements with no details, no questions, and no code …

Member Avatar for I_m_rude
0
2K
Member Avatar for every1play

1) You don't -- this is the **C** forum. 2) Set insert mode off, set the cursor on the **s**, and type.

Member Avatar for deceptikon
0
249
Member Avatar for PinoyDev

> these small programs doesn't really need inheritence, It does if > The main purpose of this example is to execute inheritance It's how we learn.

Member Avatar for iamthwee
0
150
Member Avatar for ALMOSTunseen
Member Avatar for starkk

The statements are [undefined](http://c-faq.com/expr/evalorder2.html) so the output is not guaranteed to be anything specific. Different compilers may produce different results.

Member Avatar for WaltP
0
88
Member Avatar for jayram.chandan

**[boilerplate_help_info]** Posting requests for help must be well thought out if you want help quickly and correctly. Your post did not meet the criteria for quality help. You may get some posts, but are they going to be useful? Check your post with these checkpoints - what is it *you* …

Member Avatar for WaltP
0
141
Member Avatar for theju112
Member Avatar for Lucaci Andrew
0
153
Member Avatar for modesto916

A couple other things worth noting: 1: `do{}while((c = fgetc(input)) != '\n');` Why a do-while? Why not just `while((c = fgetc(input)) != '\n');`?? 2: `fseek(input, -1, SEEK_CUR);` Why? Can't you do something better/cleaner than messing with the file pointer? It looks like you're already handling the case without the `fseek()`. …

Member Avatar for modesto916
0
264
Member Avatar for every1play

It's what happens when you set up an array like `int array[10]` and use a statement like `array[12] = 23;`. There *is* no `array[12]`. It only goes to `array[9]`. In your case, `"123"` is **4** bytes, not 3. it's '1','2','3','\0'. You forgot about the string indicator.

Member Avatar for nishavas01
0
212
Member Avatar for harinath_2007

Not a good idea IMO. 1) Many (most) of us won't open attached files or linked images. We certainly won't watch a video. 2) As you pointed out, "*It may require huge database and huge maintainence of daniweb server.*" Who's going to pay these extra costs? 3) You gave the …

Member Avatar for JorgeM
0
194
Member Avatar for daino

GUI means Graphical User Interface. It has nothing to do with triggering anything. It's all the pretty stuff in windows, like title bars, sizable windows, arrow cursor, menus, icons -- all the stuff people *think* a computer must have. IMO, if you're such a rookie, you don't need to understand …

Member Avatar for daino
0
261
Member Avatar for Vish0203

Also `printf()` is a very expensive way to output a single character. Better to use `putchar('*')` because it's made specifically to output a single character.

Member Avatar for Vish0203
0
125

The End.