5,676 Posted Topics

Member Avatar for ARKaMAN
Member Avatar for Ketsuekiame
0
192
Member Avatar for chialoo
Member Avatar for WaltP
0
126
Member Avatar for trevs234

Look up [ICODE]srand()[/ICODE] and [ICODE]rand()[/ICODE]. Then use an [ICODE]if[/ICODE] statement.

Member Avatar for WaltP
0
232
Member Avatar for mr.confused!

[QUOTE=mr.confused!;]In your opinion, when creating a nested loop is it best to use the call function and if so is using a pointer the route to go when creating the function?[/QUOTE] That's like asking when ordering a hamburger is it better to drive a Mustang? The things in your question …

Member Avatar for jephthah
0
145
Member Avatar for BestJewSinceJC

[QUOTE=~s.o.s~;1221196]Dani, please make it so that quotes are hidden by default...[/QUOTE] NOOOOOOOOOOOOOOO! Oh Please NO!

Member Avatar for Ezzaral
0
114
Member Avatar for jephthah
Member Avatar for jimJohnson

#1) Use CODE Tags #2) [url=http://www.gidnetwork.com/b-38.html]Format your code[/url] so we can follow it #3) Are we supposed to guess what issues you are having? #4) You don't need a [B]switch[/B] statement, especially one like that

Member Avatar for WaltP
-2
131
Member Avatar for speedy94519

[url=http://www.gidnetwork.com/b-58.html]Read this[/url] And start using CODE Tags.

Member Avatar for WaltP
0
201
Member Avatar for 3cats

[url=http://www.gidnetwork.com/b-38.html]Format your code[/url] better and the problem will smack you in the face...

Member Avatar for 3cats
0
136
Member Avatar for cwarn23

[QUOTE=~s.o.s~;] @Everyone This is normally how new changes are rolled out on Daniweb. The new features which need to be introduced are made live, feedback is collected from regulars, changes are made to the site, rinse and repeat. I'm pretty sure that with the help of suggestions given by the …

Member Avatar for Froger93
0
249
Member Avatar for triumphost

It would make much more sense to do this instead [code] ifstream Dict ("C:/Users/Brandon/Desktop/Programs C++/Dictionary.txt"); //file to read if (!Dict.is_open()) { return -1; /*error */ }; ifstream file ("C:/Users/Brandon/Desktop/test.txt", ios::out | ios::app | ios::binary); //file to write if (!file.is_open()) { return -1;/ /*error */ }; [/code] Why open the test …

Member Avatar for triumphost
0
343
Member Avatar for fxm
Member Avatar for WaltP
1
162
Member Avatar for tcotto

If you're going to load [I]numlist[/I] with the list of primes, the loop [CODE] for (i=2; i<10000; i++) { numlist[i]=1; } [/code] is unnecessary. Also, what values will [I]numlist[0][/I] and [I]numlist[1][/I] contain? The [I]for[/I] statement is wrong [ICODE]for (p*p<=n; n<10000; p++)[/ICODE] The first field [I]p*p<=n[/I] cannot be a comparison to …

Member Avatar for 0x69
0
104
Member Avatar for BestJewSinceJC

But it's for a thread, not a post. It belongs at the bottom of the thread, maybe avove the reply box for easy access.

Member Avatar for happygeek
3
224
Member Avatar for jeeter19

#1) Do NOT Bump on these forums. It's rude. When someone that can help sees your post, they will answer. #2) There is no sense in making threads if only one thread at a time can be created. That defeats the purpose of threads. #3) A [iCODE]void[/iCODE] function cannot return …

Member Avatar for abhimanipal
0
111
Member Avatar for babydol

[QUOTE=Ketsuekiame;]If memory is not an issue and you're running on a fast machine there's no reason not to go with them for complex and large arrays. On a single dimensional array of 10 ints...There's no point choosing anything other than an array of int =)[/QUOTE] And, if someone is having …

Member Avatar for WaltP
0
106
Member Avatar for jelinky
Member Avatar for jamesbondbest

By SHOUTING at us. Please don't shout again. Are the lengths of [B]cm[/B] and [B]st[/B] the same? Output each [I]char[/I] in each string as an integer and see if they look the same.

Member Avatar for WaltP
0
97
Member Avatar for JohnJ_21

[QUOTE=JohnJ_21;362264]I was wondering if anyone could help me [/quote] We certainly can help... [QUOTE=JohnJ_21;362264](if you wanna do it... that would be awesome, i got 3 other finals in 2 days as well. Save me some time :) )[/QUOTE] Oops, you just lost my help here. If you had left out …

Member Avatar for WaltP
0
145
Member Avatar for Dave Sinkula

You could, but a [I]real[/I] programmer wouldn't use [ICODE]scanf()[/ICODE] or [ICODE]fscanf()[/ICODE] to read strings in the first place. [B]Dave[/B]'s suggestion is the second best choice. Best is to use [ICODE]fgets()[/ICODE]

Member Avatar for Narue
0
2K
Member Avatar for Eternal49

[code=c] int remain1[8]; int remain2[8]; int remain3[8]; int remain4[8]; int * remain[] = {remain1,remain2,remain3,remain4}; [/code] Why? Why not a simple [ICODE]int remain[4][8];[/ICODE] ??

Member Avatar for abhimanipal
0
197
Member Avatar for ams_chelseafc

[QUOTE=ams_chelseafc]I have written the following Code which will convert an integer number to a roman..I have a array list of integer number which I pass through a for loop and the return value is individual converted Roman character.. My Issue is when the converted value is returned from the function …

Member Avatar for jephthah
0
811
Member Avatar for leesho

Don't know. What it do wrong? If you want help you really need to explain. Read the Member Rules. The thing I noticed is your [iCODE]srand()[/iCODE] is in the wrong place. Put it at the beginning of the program so it's called only once.

Member Avatar for WaltP
0
161
Member Avatar for noobuser

[QUOTE=gerard4143;1217681]Don't and I mean don't ever use [CODE] gets(myString); [/CODE] Read Please BUGS Never use gets(). Because it is impossible to tell without knowing the data in advance how many characters gets() will read, and because gets() will continue to store characters past the end of the buffer, it is …

Member Avatar for noobuser
0
175
Member Avatar for speedy94519

A local variable ([B]str3[/B]) is deleted once the function ends. First, loop through the [B]to[/B] string to find the \0. Second, now loop through [B]from[/B] copying each character to [B]to[/B]. Return [B]to[/B].

Member Avatar for anonymous alias
0
361
Member Avatar for sourabhtripathi

[I]>The usual method used to convert a decimal to binary number is to store the successive numbers in a stack...[/I] Or in an array representing each bit.

Member Avatar for abhimanipal
0
159
Member Avatar for Dave Sinkula

[QUOTE=GrimJack;1172015]... Sweden, Germany, [B]BeNeLux[/B], etc.[/QUOTE] Isn't [B]BeNeLux[/B] a vacuum cleaner? :icon_twisted:

Member Avatar for jephthah
0
6K
Member Avatar for Dinglish

[QUOTE=Dinglish;1213130]i have a piece of an unfinished program. try to run it...[/QUOTE] No. If you post [I]readable[/I] code, we can follow it. Please format your code cleanly and consistently. [url=http://www.gidnetwork.com/b-38.html]See this[/url]. [QUOTE=Dinglish;1213130]if you go straight to option 3 and input values, how do i output these values in option 4 …

Member Avatar for Dinglish
0
124
Member Avatar for boiishuvo

[QUOTE=boiishuvo;1209065]The file is a text says "the quick brown fox jumps over the lazy dog", but when I ran the program, it showed some random number than I expected [/quote] No, it showed a specific number -- the value of [B]fp[/B] which is [I]not[/I] and integer displayed as if it …

Member Avatar for abhimanipal
0
2K
Member Avatar for Daocsm

Look for an initialization file (maybe [B]db.ini[/B]) when the program starts. If the file does not exist, accept the connections string and any other values you need, write the data to the file. On each subsequent program starts, read the file to retrieve the values.

Member Avatar for Ionelul
0
100
Member Avatar for Geneva Dirt
Member Avatar for Mekalor

Try posting your code readably and someone might be able to follow it. Indenting is a good thing, but indenting 8 characters is usually overkill, as your code shows.

Member Avatar for Mekalor
0
120
Member Avatar for ddanii

Open the file in binary mode and use binary output functions, not [I]fprintf()[/I]

Member Avatar for ddanii
0
114
Member Avatar for muthu.job2009
Member Avatar for MageBane
-2
70
Member Avatar for sgriffin

I'd say there's probably something wrong with the [I]rh.item[/I] matrix. Or switching the indecies is not the proper solution for your printing error.

Member Avatar for WaltP
0
81
Member Avatar for Eternal49

Because -- 1) when you are outputting data with [I]printf()[/I] you pass the value into the function. 2) when you are inputting values with [I]scanf()[/I] you pass the address of the variable so the value can be passed back.

Member Avatar for Eternal49
0
124
Member Avatar for Robert1995

Please [url=http://www.gidnetwork.com/b-38.html]format your code[/url]. It is really difficult to read and follow. Because I can't read the code, I'll make a guess. You are defining an array of pointers, and attempting to stuff data into the pointers. But there is no data space defined. Just pointers. That will cause your …

Member Avatar for Robert1995
0
206
Member Avatar for lightshift

To move, you need another matrix. [B]board[/B] is for the current state, [B]newboard[/B] is for the next generation. Once you fill [B]newboard[/B] copy it into [B]board[/B].

Member Avatar for lightshift
0
252
Member Avatar for sofakingjewish

Please look at the code you're posting. Can you actually read it? Please [url=http://www.gidnetwork.com/b-38.html]see this[/url], and maybe we can read it, too.

Member Avatar for jonsca
0
172
Member Avatar for fellixombc
Member Avatar for kalrajhi

If you are inputting into an integer variable, you cannot test for characters because they can't be entered into an integer. If you input into a string you can then test if the values are digits or not.

Member Avatar for kalrajhi
0
175
Member Avatar for restrictment

Set up a 52 int array called [I]deck[/I]. Load each value with it's index: [iCODE]for (i=0; i<52; i++) deck[i]=i;[/iCODE] Now do what [B]iamthwee[/B] suggested. This becomes your shuffled deck. Each entry in [I]deck[/I] can be converted into a number/suit pair with / and %. Then use your [B]suitname[/B] and [B]numbername[/B] …

Member Avatar for iamthwee
0
196
Member Avatar for dadeejay007
Member Avatar for WaltP

Just found this recipe, thought I'd share it: [url]http://www.cgl.uwaterloo.ca/~csk/water.html[/url]

Member Avatar for Ene Uran
1
164
Member Avatar for vmanes
Member Avatar for Dewey1040

What is a point? What are it's parameters? What can you do with a point? Where can they exist? Basically, you need to create a class that can fully(?) defines what a point is, and decide what a point can be used for and create functions that can make the …

Member Avatar for mrnutty
0
164
Member Avatar for rejina

How about [CODE] Dim I As Integer, MyCharacters As String MyCharacters = "ThisWord" For I = 1 To len(MyCharacters) MsgBox mid$(MyCharacters I1) Next I [/CODE] It's simple. No redimming or ubounding.

Member Avatar for vb5prgrmr
0
524
Member Avatar for sonny tran
Member Avatar for Lerner
0
108
Member Avatar for appunu
Member Avatar for johndoe444

The End.