5,676 Posted Topics

Member Avatar for squizzel

Every time you go throught the loop when **k** equals **i-1** you have a match. Start the **i** loop at **k+1** and get rid of the +1 elsewhere in that section. Also, the standard way to do loops is if you defined the array as `A[20]`, your loop is set …

Member Avatar for squizzel
0
171
Member Avatar for markjoe.online
Member Avatar for jwill222

If you had string studentName; int grade not in a structure, how would you do it?

Member Avatar for WaltP
0
142
Member Avatar for ShEeRMiLiTaNt

> This functin is designed to go through the rows that I've allocated in my dynamic array and see if it the user inputed a valid lab number. It doesn't do anything. All the function does is increment a pointer and the steps. And `if (*rowWalker == NULL)` is TRUE …

Member Avatar for WaltP
0
157
Member Avatar for Bubbles26

No. They are just a different way of doing it. And you'd still need a loop anyway. IMO, your technique is just fine without the class. Although, if you notice, every one of your input sections look exactly the same: cout << "Enter the number of XXX Dollar Bills you …

Member Avatar for Bubbles26
0
196
Member Avatar for iamthwee

I use the undo option when I decide I want to remove my vote, not because I accidently added a vote. > I still think it would be a good idea to change the dropdown (wording) to know if you've hover over an up or down arrow... No it wouldn't. …

Member Avatar for Mike Askew
0
459
Member Avatar for Mike Askew

>Why don't you try using FireFox. Its fast and sleek. > >> Patient: "Doctor, it hurts when I blink." >> Doctor: "Don't blink." Isn't it more like: Person A: My car needs a brake job. Person B: Why don't you get a new car?

Member Avatar for Mike Askew
0
216
Member Avatar for RAPTOR88

/* This function is used to calculate how many of each coin is needed */ int RepeatedlyCoins (int ¢s, int coin_worth) { What is the first parameter in this function definition? Never seen a variable like that.

Member Avatar for WaltP
0
350
Member Avatar for binaryjc

Line 38 you probably want `diff_w` and `suitor_w` Sort on the value you want (`diff_w` or `diff_h`). Make sure you swap **all** the arrays. Then output your data for that sort.

Member Avatar for WaltP
0
262
Member Avatar for kiwi101

> please write this code for me!! Im in dire need!! Why do you people continually ask us to do your work for you? This constant request for cheating is really getting annoying! Find something else to do.

Member Avatar for WaltP
0
156
Member Avatar for anonymous213

> can you keep it like a computer science I beginner level with the same functions and variables as i had up top So what you want is to for him rewrite your homework for you so it looks like *you* wrote it, not an expert? Wouldn't it be better …

Member Avatar for triumphost
0
308
Member Avatar for kisseric

And yet [I]another[/I] hijack bump to a 6 year old thread. I don't think he read even one thing he was asked to read upon registering, so why would he read the important stickys and announcements at the top of the forum itself?

Member Avatar for manujkathuria
-4
1K
Member Avatar for cih1091

You need to break up your loop into multiple loops. 1st) read the entire file in one loop 2nd) sort the data using two loops 3rd) the rest of the program

Member Avatar for WaltP
0
116
Member Avatar for salakgocap

Either 1) print the ##### before you start the `while` loop 2) set a flag named **FirstLineFlag** to true before you enter the loop and set it to false after you print. You can work out the rest of the details.

Member Avatar for WaltP
1
105
Member Avatar for zeeters

If you aren't sure how **find** works, you should forget all the other parts of the program for the moment and just program various uses of **find** until you understand how that works. That will make programming the rest of the task easier.

Member Avatar for zeeters
0
3K
Member Avatar for LukeJames

If you consider MicroSluge awesome, I suppose so... 8] IMAO, I'd change color schemes quick so as not to be assiciated with *them* :o)

Member Avatar for JorgeM
0
229
Member Avatar for farah.hany.31

Each peg is an array. Load peg 1 with the disks peg[0] = 1 peg[1] = 2 etc Each time you move a disk you must take the **last** value in the array and place it in the first **open** location in the new array/peg

Member Avatar for WaltP
0
92
Member Avatar for RonKevin

You were told [here](http://www.daniweb.com/software-development/cpp/threads/435399/shortcut-in-reading-a-.txt-file#post1869659) about `void main()`, *conio.h* You were told [here](http://www.daniweb.com/software-development/cpp/threads/435132/hello-c-experts#post1868257) about *conio.h*, `void main()`, putting non-code into your code to confuse us. You were told [here](http://www.daniweb.com/software-development/cpp/threads/432311/deleting-an-element#post1853891) and [here](http://www.daniweb.com/software-development/cpp/threads/432311/deleting-an-element#post1853925) about `void main()` And [here](http://www.daniweb.com/software-development/cpp/threads/432311/deleting-an-element#post1854009) about using `goto` [here](http://www.daniweb.com/software-development/cpp/threads/435243/do-i-have-to-start-a-new-discussion-whenever-a-question-is-solved#post1869159) again `void main()` was mentioned. And I know `goto`, *conio.h*, formatting …

Member Avatar for WaltP
0
148
Member Avatar for shanki himanshu

**nitin1** is correct. With a little more detail: Any number that starts with a zero is interpreted in base 8 (octal) rather than base 10 (decimal). Therefore your 011 is: `one 8 and one 1` rather than `one 10 and one 1`.

Member Avatar for shanki himanshu
0
155
Member Avatar for chris.vargas.773

Yes we can, but we can't read it because of the lack of formatting. [See this](http://www.gidnetwork.com/b-38.html) [See this too](http://www.gidnetwork.com/b-66.html) Do not use `goto`'s and get rid of the `label`'s

Member Avatar for np complete
0
195
Member Avatar for rithish

Your code won't compile with that extra *meaningless* text at bottom of the program.

Member Avatar for Gonbe
0
196
Member Avatar for RonKevin

1) `void main()` is wrong. [See this](http://www.gidnetwork.com/b-66.html) 2) `conio.h` is non-standard. You do not need it. 3) [format](http://www.gidnetwork.com/b-38.html) your code properly. > i'm thinking of using an array...the code ive done would read the first line right? Right. >but i want to read as an array if it would be …

Member Avatar for RonKevin
0
319
Member Avatar for somjit{}

What **type** did you enter with `scanf("%c",&option);`? What's the binary value of the input? What **type** did you compare with `case 1:`? What's the binary value of the test value?

Member Avatar for somjit{}
0
416
Member Avatar for hg_fs2002

Good question. Write a short program and output the value. Does it compile properly? If so, what does it output?

Member Avatar for deceptikon
0
220
Member Avatar for rithish

Output the values you use in the loop and see what they generate. When you see that the values are wrong, you then know what to look for to fix the problem.

Member Avatar for WaltP
0
151
Member Avatar for marius2010

In your original description you said > Given number n ( n<=9999) Inputting a **string** is not a number. You need to rethink your program and reconsider [this](http://www.daniweb.com/software-development/cpp/threads/433882/simple-math-c#post1861728) suggestion.

Member Avatar for WaltP
0
369
Member Avatar for demingd

`array = new int [size];` Wrong syntax. Look up the correct syntax again. Also, what is the value of **size** at that point of the program? Hint: It's probably not zero.

Member Avatar for WaltP
0
230
Member Avatar for mharks.newton

> can you please help me with this.. Sure we can, don't get your knickers in a twist! The best help you can get is [format your code](http://www.gidnetwork.com/b-38.html). Most likely your problem will become immediately apparent.

Member Avatar for Ancient Dragon
0
201
Member Avatar for WaltP
Member Avatar for Grandiago

**owenransen**, you are completely correct. The reason is the \ character defines the *next* character as an 'escaped' character. \n = new line \f = form feed \t = tab etc. So, `myfile=fopen("C:\Documents and Settings\Migs\Desktop\test.txt","r");` contains 2 escaped D's, 1 escaped M, and 1 escaped T (tab). That does not …

Member Avatar for WaltP
0
167
Member Avatar for niyasc

Why are you using `fscanf()` to read a single character? The overhead is tremendous. `fgetc()` was specifically made to read a character. It's small and concise.

Member Avatar for niyasc
0
203
Member Avatar for klharding2

What's `q=((2*i)+1);` supposed to be doing? If you wan tthe factorial of 7, why are you passing 15 to the function? Won't that give you 15! ?

Member Avatar for WaltP
0
92
Member Avatar for RonKevin

>Do i have to start a new discussion whenever a question is solved? Not if it's a continuation of the original program. Although if you *mark* it solved, many people will bypass the discussion.

Member Avatar for WaltP
0
199
Member Avatar for dasdsaasd
Member Avatar for klharding2

> Is there a reason I can not do that with this code? Probably because the file isn't in the same directory as the .exe, as already explained. Alternatively you have *debug* turned on and it needs to be in the *debug* diectory of the project.

Member Avatar for deceptikon
0
489
Member Avatar for jerlisacoleman

> I really dont understand any of this... OK, translation: > You are going to convert feet and inches or pounds in this program. You will write a conversion program that converts feet into inches and inches into feet. It must also handle pounds (presumably into ounces). > You will …

Member Avatar for NathanOliver
0
363
Member Avatar for somjit{}

> Secondly, never, ever use gets, always use fgets, so not gets(sh); but fgets(sh, sizeof sh, stdin); it is safer since you can't overwrite the buffer,... And the exact same thing goes for using `scanf()` to read strings. It's as bad as `gets()`.

Member Avatar for WaltP
0
394
Member Avatar for RonKevin

1) Stop putting your question into your code. Your question is **not** code. 2) `#include<conio.h>` -- don't use this. It's not standard and is not necessary. 3) struct BuyerInfo { int id; string fn; string mn; string ln; string ad; };BuyerInfo info; Why is the first semicolon in this line: …

Member Avatar for RonKevin
0
233
Member Avatar for Dani

When I delete a post (as least one of my own) I click the DELETE button twice before it changes to UNDELETE. Sounds related to the refresh somehow. > Is it just me, or when you vote with a comment, does the comment not instantly show up like it's supposed …

Member Avatar for nitin1
4
196
Member Avatar for Stagnant

You know, you *could* ask a question or two that will lead us to understand what you are having trouble with and actually be able to lead you to a solution or two.

Member Avatar for WaltP
0
3K
Member Avatar for aaal

1) **side1** has no value so you are passing junk onto `myTriangle.setside1()` 2) `myTriangle.setside1()` is a void function and returns nothing, therefore you can't load that nothing into **side1**

Member Avatar for aaal
0
200
Member Avatar for zoomblue2000

**The Dragon** gave you a major clue. Try reading about `fscanf()` and try some things. Testing is the best way to learn.

Member Avatar for zoomblue2000
0
293
Member Avatar for markwiering

> It is quite fundamentally flawed Agreed. And the [formatting](http://www.gidnetwork.com/b-38.html) is terrible. Calling `system()` is not necessary and not portable. When compiling on my Linux system the program doesn't work as advertised. On my Windows system I get nauseous with all the blinking screens. Too many convoluted IF statements where …

Member Avatar for markwiering
0
1K
Member Avatar for Iamateur

> Is fputc() used to save in files? Yeas it can. But is it appropriate for *your* program? What did the tutorial tell you to do? >I know the logic d above u wrote,I actually want the syntax to store it in file after comparison Of course you do. It's …

Member Avatar for Iamateur
0
139
Member Avatar for kera.alexander

I would suggest you open your book and look at the chapter on arrays. your question is sooooo basic that it's in there.

Member Avatar for WaltP
0
91
Member Avatar for somjit{}

> this is a code from the book "the C programming language" by dennis ritchie I'm looking at the code in the book right now. Your code doesn't look like the code in the book. They wrote the code with indentation so that it's easy to follow. Look at the …

Member Avatar for WaltP
0
199
Member Avatar for jdh1231
Member Avatar for logic20
Member Avatar for dmose13

What is the result of 10 % 10? How can that answer be used to output the value you want?

Member Avatar for dmose13
0
140
Member Avatar for kinge504

Please [format your code](http://www.gidnetwork.com/b-38.html) so we can follow/read it

Member Avatar for NathanOliver
0
605

The End.