5,676 Posted Topics

Member Avatar for kebbby

First, please format your code properly so we can follow it. All loops and ifs need to be indented: [CODE]Dim q, e, g As Integer 'parr(mini) = maxi If mini <> maxi Then If nop > 0 Then For e = 0 To maxi + 1 'On Error GoTo hell …

Member Avatar for AndreRet
0
1K
Member Avatar for w1mark

Since you are using a C++ string, use the string functions .find(), .substr(), .erase() With a simple GOOGLE search I found [url=http://www.cprogramming.com/tutorial/string.html]this[/url]

Member Avatar for w1mark
0
539
Member Avatar for skips

[QUOTE=Greywolf333;1492642]Use peek to see what's ahead one character. This is probably the easiest way, but maybe not the most efficient.[/QUOTE] Yes, inefficient, and bad. You have to read the next character anyway, so why peek, then read? Look at line 27. Is that an assignment?

Member Avatar for skips
0
151
Member Avatar for narunaru

Take it a step at a time. Create the class, output the board. When you can do that move on to the next step whatever you think that is. You add information to the class as you discover you need it.

Member Avatar for narunaru
0
663
Member Avatar for anu07
Member Avatar for anu07
0
413
Member Avatar for chess2009

See the [url=http://www.daniweb.com/forums/faq.php?faq=aup]Acceptable Use Policy[/url], section [B]Posting[/B].

Member Avatar for crunchie
0
133
Member Avatar for geoffy0404
Member Avatar for rlamarche
Member Avatar for chess2009

You need to use a flag to keep track of whether or not a \n has already been output. Start with the flag set to TRUE. When you output a character, set the flag to FALSE. When you want to output \n, test the flag. If the flag is FALSE, …

Member Avatar for WaltP
0
432
Member Avatar for axeves
Member Avatar for PerplexedWon

[QUOTE=PerplexedWon;]Problem I am experiencing: When I compile my code, I get these two error codes: 1) In file included from C:\Users\PaulWilliams\Desktop\CSci Work\C++ Programming\TestScores.cpp 2) unterminated #ifndef I am not understanding what I did wrong, [/QUOTE] [U]Unterminated[/U]: Without end; having no termination. from wordnik.com does not end, conclude, or cease. from …

Member Avatar for PerplexedWon
0
203
Member Avatar for bob200707

[QUOTE=BitBlt;]I did some COBOL in the 80's and 90's under DOS/VSE, MVS and VSE/ESA. Also, some MicroFocus Cobol under PC-DOS back in the day. What is your question?[/QUOTE] I'm sure after 4 months he's was just waiting for someone to ask him to post his question :icon_rolleyes:

Member Avatar for WaltP
0
158
Member Avatar for george61

Also, in your editor's options set the TAB key to add 4 SPACEs instead. All those TABs make the code harder to read.

Member Avatar for WaltP
0
332
Member Avatar for bkoper16

You need to rethink these comparisons. Read them out loud and see if they sound correct: [CODE] if (200 <= salary && salary <= 299) else if (300 <= salary && salary <= 399) else if (400 <= salary && salary <= 499) else if (500 <= salary && salary …

Member Avatar for template<>
0
212
Member Avatar for geoffy0404

Because integer division truncates. [ICODE]200 * (1/2) = 0[/ICODE] because 1/2 = 0 using integers. Cast your values to floats during the equation: [ICODE](float)200 * ((float)1/(float)2) = 100[/ICODE]

Member Avatar for WaltP
0
132
Member Avatar for Incubator

Since you didn't post any code, we have no way of knowing what you did wrong. This is a very simple task and how you tried to do it will tell us what to suggest. Otherwise you get suggestions like the one above by [B]rxlim[/B]

Member Avatar for WaltP
0
151
Member Avatar for ik1610

[B]numberOfColumns[/B] is not a "[I]constant value[/I]" so you can't declare your array the way you did.

Member Avatar for ik1610
0
107
Member Avatar for Soup!

Please see [url=http://www.gidnetwork.com/b-38.html]this to format your code[/url] so we can read it (it's very hard to follow as it is) and also [url=http://www.gidnetwork.com/b-66.html]this about main()[/url]. What is the value of [ICODE]sizeof names[i][j][/ICODE]? Are you sure this is what you want? It really helps to print the value of important variables …

Member Avatar for jnawrocki
1
207
Member Avatar for slygoth

It isn't possible with Standard C. You have to learn special function added by the compiler authors for your specific compiler and operating system.

Member Avatar for Arbus
0
336
Member Avatar for slygoth

[QUOTE=slygoth;1489442]I need some help with the toupper code. [code] int main() { char pick; printf("A. Local needs\n"); printf("B. Local Service\n"); scanf("%d",& pick); switch (pick) { case 'a': printf("Hello World"); case 'b': printf("Hello Nation"); } getch() return 0; } [/code] How would i implement the toupper code so i could change …

Member Avatar for jnawrocki
0
167
Member Avatar for zachcoenen4

1) How can you have 2.4 dimes? Or 3.7 quarters? The values of the denominations only need to be integers. 2) Have you spent 6 hours sitting in front of the computer just whacking at the code hoping you get the right answer? If so, you are missing the most …

Member Avatar for WaltP
0
391
Member Avatar for Zvjezdan23

[QUOTE=Zvjezdan23;]However, in my switch statement it does not generate random numbers like it did earlier. You'll see what I mean. [/quote] There are only 5 switch statements. And how would we see what you mean? You didn't bother to describe it. [QUOTE=Zvjezdan23;]Other than that I need help with the scoring …

Member Avatar for Fbody
0
625
Member Avatar for caltech
Member Avatar for caltech
0
195
Member Avatar for plang007

Don't make new threads for the same problem. Continue with the old thread. And you know you could just post the relevant code, not the entire thing.

Member Avatar for WaltP
0
206
Member Avatar for jasoncastro
Member Avatar for Ajinkyanaik
Member Avatar for HASHMI007
Member Avatar for plang007

I don't see an "[I]an EOF controlled while loop[/I]" anywhere in the code at all. We can't help fix what's not there. Set up the WHILE loop, read from [I]inFile[/I], and when EOF is reached, exit the loop.

Member Avatar for plang007
0
244
Member Avatar for pg5678

No. An array is a list of values. Values can't call functions. Only code can call functions.

Member Avatar for gerard4143
0
147
Member Avatar for determine

[QUOTE=Labdabeta;1488335] Also although it is generally best to avoid OS specificity and keep C++ platform independant, sometimes it is more powerful to just use the system. (for example the horrible [in my opinion] language of VB is highly OS dependant on windows, yet it is an extremely powerful language that …

Member Avatar for determine
0
4K
Member Avatar for ejiroy

[QUOTE=ejiroy;1487993]I am trying to make a program that will read in a text file and count the number of words that have a certain length from 1 to 20. So it should count the words that have a length of one, two, etc., and print it out. I have been …

Member Avatar for nezachem
0
114
Member Avatar for Crutoy

[QUOTE=Crutoy;1488399]But then im gonna lose the the sizes it might mean that larger disk can be placed on the smaller. With that logic i can't know which disk is larger all i know is it has a disk on peg. I must be stupid i just don't see it.[/QUOTE] No, …

Member Avatar for Crutoy
0
210
Member Avatar for anu07

[QUOTE=anu07;]This is my computer science project,we were told to make any software we wish to make,so I thought about making a calculator,below is the code,but it doesn't seem to be functioning well,could anyone help and tell me what went wrong(I am using borland cpp 4.5 compiler,this program uses getch() to …

Member Avatar for anu07
0
189
Member Avatar for antichix
Member Avatar for Dani

The change doesn't seem to be working correctly. QUOTING: [I]Now, when you are using the quote tags that show/hide the quote, the first line of the quote always shows up. This gives you a sneak peek to refresh your memory what the quote is, and which line of the person …

Member Avatar for WaltP
0
202
Member Avatar for ogrishmania

You gave up? The process is simple. Each year has 365 days. Every year divisible by 4 (Leap Year) has 366. Every month has a set number of days (except month 2 in LY). A simple matter of addition. 1) How many years*365 2) Add in # of leap years …

Member Avatar for WaltP
0
2K
Member Avatar for cutedipti

There is a difference between a character array and a string. A character array [ICODE]char a[3] = {'a', 'b', 'c'};[/ICODE] is not a string. Just because it happens to end in a '\0' when you don't define all the elements [ICODE]char a[3] = {'a', 'b'};[/ICODE] does not make it a …

Member Avatar for gerard4143
0
275
Member Avatar for SolidSora

Read the line using [iCODE]getline()[/iCODE]. Find the [I]last[/I] SPACE. Everything before is the first/middle name, after is last name.

Member Avatar for atticusr5
0
110
Member Avatar for Stefano Mtangoo
Member Avatar for Stefano Mtangoo
0
452
Member Avatar for Dundir

Draw the the pattern on paper. Analyze the numbers you need: 1) for each given line number 2) how many leading spaces 3) how many characters 4) how many trailing spaces Look for a numerical pattern that can be programmed.

Member Avatar for WaltP
0
80
Member Avatar for spoonlicker

[QUOTE=spoonlicker;]I have no idea at all, nothing, on how to make a full, running and working snake game.[/quote] Then you should probably do something you at least have an idea how to do. Do this project later when you're not so clueless. [QUOTE=spoonlicker;]... And I mean do it with out …

Member Avatar for kayhantolga
0
358
Member Avatar for jasoncastro

Line 26: Ouput [B]account[/B], [B]string2[/B], and [B]string3[/B]. See what the values are. Also, are [B]string2[/B] and [B]string3[/B] useful names? What are they for? The answer will give you better variable names for them.

Member Avatar for jasoncastro
0
345
Member Avatar for txwooley

If you go to the casino, you will never see the dealer 'pick a random card from the deck' (your technique), they 'randomize the deck' (shuffle) and deal top to bottom (use an index).

Member Avatar for WaltP
0
154
Member Avatar for rbduck09

You never put a value into [iCODE]d[/iCODE] therefore [iCODE]if ( d < 1 )[/iCODE] is comparing junk with 1.

Member Avatar for rbduck09
0
224
Member Avatar for f.damati

[QUOTE=Charu_U;]why don't you share your code, so that i can modify it to give required result.[/QUOTE] Yes, the Original Poster (OP) should share his code, but [I][B][U]you[/U][/B][/I] do not modify it to get it to work. We do not approve of cheating. [I]You[/I] can give suggestions on how to fix …

Member Avatar for WaltP
0
94
Member Avatar for Muhammad Sumair

Find a copy and put it in the [I]include[/I] directory. But if you expect it to work, the real answer is you can't. VC++6 has no graphics functionality that works with graphics.h

Member Avatar for Muhammad Sumair
0
183
Member Avatar for VP2

Also, since this is the C forum, using C++ commands to do the work will just confuse and frustrate anyone trying your suggestions. A for effort, F for execution.

Member Avatar for WaltP
0
459
Member Avatar for efronefron

[QUOTE=gerard4143;]Also, why all the comments its really distracting.[/QUOTE] Because good programmers comment their code so others can follow it. [QUOTE=efronefron;]sorry its an assignment from my university so I have to write all that comments. I hate it too so please bear with me :/[/QUOTE] Don't apologize. Keep it up. Comments …

Member Avatar for WaltP
0
214
Member Avatar for Awesumlewy

[QUOTE=richieking;]Start looking into vector ok? its more flexible and a template. This mean you can extend your code to other data types. [/QUOTE] You're kidding, right? What is the Total, Average, and Mean of a list of names? :icon_rolleyes:

Member Avatar for richieking
0
173
Member Avatar for VP2

ASCII characters are just numbers. So if you wanted onthe the upper case letters for example, the are 'A' thru 'Z', or 65 thru 90. So 1) limit your random value from 0 to 25 (number of letters) 2) add 'A' or 65 to it. That will give you all …

Member Avatar for WaltP
0
155

The End.