5,676 Posted Topics

Member Avatar for chunalt787
Member Avatar for zulqadar
Member Avatar for rkulp

Set up another array of 16 (say [ICODE]ptr[/ICODE]) with values from 0-15, randomize that array. Then you access the [ICODE]dice[/ICODE] array: [CODE]r = random value (0-15) dice[ptr[r]][x] [/CODE]

Member Avatar for rkulp
0
108
Member Avatar for anthony5557

[QUOTE=anthony5557;1107715]does anyone know how to make an array search for how many words are in it?[/QUOTE] Yes... I do. See the end of your last thread.

Member Avatar for mrnutty
0
186
Member Avatar for anthony5557

No, you don't wan tto use the [iCODE]reverse()[/iCODE] method. You learn nothing by letting the compiler designers do your work for you. 1) Do you want to reverse the word into a separate string? 2) Or do you want to reverse the the string in place? If (1), just loop …

Member Avatar for hag++
0
2K
Member Avatar for Gaiety
Member Avatar for fadia

Private members cannot be output directly because they are private to the class. Nothing outside the class knows it exists. Create a method that returns the value and output via that method: [CODE]int getVariableName() { return VariableName; } [/CODE] [ICODE]cout << getVariableName();[/ICODE] And please learn to [url=http://www.gidnetwork.com/b-38.html]format your code[/url] better …

Member Avatar for WaltP
0
124
Member Avatar for WaltP

I have the following code in a form: [code=php] <? for ($n = 0; $n < count($filelist); $n++) { printf ("<button type='submit' name='imgnam' value='%s'>", $filelist[$n]); printf ("<img src='%s' width='100' />", $dirname . $filelist[$n] . ".gif"); print "</button>"; printf ("<br>%s</p>\n", $filelist[$n]); } ?> [/code] [ICODE]$dirname[/ICODE] contains the directory value [ICODE]$filelist[][/ICODE] contains …

Member Avatar for WaltP
0
139
Member Avatar for merse
Member Avatar for 006ruler
Member Avatar for cpeister
0
165
Member Avatar for cwarn23
Member Avatar for Dave Sinkula
Member Avatar for bhushnxx

Somebody forgot to read the Forum Rules as requested multiple times upon signing up.

Member Avatar for Ancient Dragon
-5
133
Member Avatar for MaxAxiss

Maybe a "Disk Controller"? Or maybe "A Board that breaks my computer when it's removed"...

Member Avatar for jbennet
0
63
Member Avatar for thekashyap

If there aren't any questions relating to the subject, it would be useless to add a forum. But if there are a lot of questions on the subject in an appropriate/related forum, then it makes sense.

Member Avatar for jbennet
0
135
Member Avatar for m7md.is

In standard C++ you can't. If your compiler is one of those that has enhancements, there may be a way, but it's non-standard and therefore not recommended.

Member Avatar for m7md.is
0
224
Member Avatar for kenoch

[QUOTE=kenoch;1102743]I have a problem with this topic ..Solution to algorithm using static and dynamic data structure[/QUOTE] I have a problem with this topic too. There is no solution to the stated problem.

Member Avatar for Rajesh R Subram
-2
96
Member Avatar for grealish234

You cannot define a function within [iCODE]main()[/iCODE]. Move it above. And thank you for using CODE tags and formatted code on your first post! What a rare thing around here!

Member Avatar for mrnutty
2
114
Member Avatar for samarudge

[QUOTE=Will Gresham;1101657]For some reason Daniweb decided to double post that for me :-O[/QUOTE] Daniweb must have thought it was worth repeating :icon_twisted:

Member Avatar for WaltP
4
189
Member Avatar for Ancient Dragon

[center][B]Sign at the End of the Universe[/B] thanks to a story by [I]Duane Ackerson[/I] (1974) [/center]

Member Avatar for WaltP
1
325
Member Avatar for t_stewart1012
Member Avatar for sisse56

The statement [ICODE]cin>>phy_name[i];[/ICODE] reads a single character -- [B]phy_name[i][/B]. You need to read the entire string using [ICODE]cin>>phy_name;[/ICODE] Adding the subscript [B][i][/B] references the [B]i[/B]'th character only.

Member Avatar for WaltP
-2
127
Member Avatar for sonisuhas

[QUOTE=Narue;1101368][B]>Let the random function print 50 numbers and I'll decipher a pattern out of it.[/B] Okay, then please do so: [list of numbers][/QUOTE] [QUOTE=nerdinator;1101420]If these numbers end here,I'd say something like: let user start with x. the series is x,x+12,x+15,x-4,... I think you get it.[/QUOTE] You're kidding, right? Yeah, we …

Member Avatar for Narue
0
137
Member Avatar for avirag

Or loop through the 'char' and use the [iCODE]num = (num * 10) + char[/iCODE] process.

Member Avatar for Narue
0
2K
Member Avatar for k1_zav

My guess, since you didn't post any actual code, is you're reaching [iCODE]G>291[/iCODE] and/or [iCODE]L>2[/iCODE]

Member Avatar for k1_zav
1
83
Member Avatar for shizu
Member Avatar for shizu
0
704
Member Avatar for Dani

I disagree. 1) I don't like the new buttons. They have a retro feel and don't really do it for me. The yellow buttons fit the look of the page IMO. 2) I prefer [I]multiquote[/I] rather than [I]Flag to Quote[/I]. The former tells me what the button does. The latter …

Member Avatar for feoperro
3
941
Member Avatar for coolfriend
Member Avatar for __kanth

Not in standard C nor C++. It requires functions that are not part of the language, but some systems and compilers have enhancements that could allow it.

Member Avatar for __kanth
0
188
Member Avatar for sisse56

Please reread [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies]the Forum Rules[/url] and pay closer attention to [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies#faq_keep_it_organized]this section[/url].

Member Avatar for WaltP
-2
130
Member Avatar for s_mostafa_h
Member Avatar for s_mostafa_h
0
252
Member Avatar for sapphyr

[CODE]cout << square << endl;[/CODE] That's because you printed the [I]value[/I] of [iCODE]square[/iCODE]. You didn't actually [I]call[/I] the function. Look up calling a function in your text.

Member Avatar for sapphyr
0
159
Member Avatar for mohamedqamar

Thank you for using CODE tags, but you need to [url=http://www.gidnetwork.com/b-38.html]FORMAT[/url] your code so we can follow it. CODE tags only work with [url=http://www.gidnetwork.com/b-38.html]FORMATTED[/url] code.

Member Avatar for Ancient Dragon
-3
177
Member Avatar for sn12

[QUOTE=sn12;398583]I am just seeking help as I need it urgently. I have read the other posts.[/QUOTE] If you want help, you have to ask a question that can be answered. Details are necessary.

Member Avatar for laharigowda53
-1
347
Member Avatar for group256

Another suggestion: [url=http://www.gidnetwork.com/b-38.html]format[/url] your code better. Indents are too deep and not consistent.

Member Avatar for pecet
0
1K
Member Avatar for balajisankar
Member Avatar for WaltP
-3
122
Member Avatar for KonkaNok

[QUOTE=jbennet;1005623]Please mark as solved.[/QUOTE] Why? The title "[I]Thoughts on Google Chrome..? [/I]" is an invite for discussion. One person saying "try this instead" is IMO not a discussion... :icon_wink:

Member Avatar for mrnutty
0
236
Member Avatar for mapla

[QUOTE=mapla;1098591][code] #include<stdio.h> int main() { char sh[100] = "ED",*stop; int test; test = strtol(sh,&stop,16); printf("Test:%d",test); } [/code][/QUOTE] Very nice. I assume it works now...

Member Avatar for prushik
-2
163
Member Avatar for phpangel

Two things: 1) Learn to [url=http://www.gidnetwork.com/b-38.html]format your code[/url] so we can read it easily 2) Where in the universe does "[I]it gives an error[/I]" follow from "[I]it runs without problem[/I]"? White is not black...

Member Avatar for WaltP
0
1K
Member Avatar for ball3r

[QUOTE=firstPerson;1098346] As for your problem, where does the player start from ? I don't see a way to get in the maze from outside, so I figure there is a starting point.[/QUOTE] [QUOTE=CppBuilder2006;1098681]I think there must be a start position too! [/QUOTE] [B]Ummm, guys, read the post:[/B] [QUOTE=ball3r;1098320] The program …

Member Avatar for WaltP
0
5K
Member Avatar for deepin

IMO, better code would be: [code=c]#include <stdio.h> void foo(void) { int i = 1; while ( i ) // or while ( i != 0) { printf("\n1: Stack1\n2: Stack2\n0: to return\n"); scanf("%d",&i); switch ( i ) { case 1: printf("1"); break; case 2: printf(" 2"); break; case 0: printf("Thank you …

Member Avatar for WaltP
0
3K
Member Avatar for Szabi Zsoldos

[QUOTE=szabizs;1097129]My question is the following, i'm just figuring out this language, now my question is about the "n" number. What is the role of n<5, i know after this condition it continues the for or not. But i can't find the precise explanation of the "n" . Thank you. [/quote] …

Member Avatar for WaltP
0
72
Member Avatar for tien113

Accept input as a single [I]character[/I] Test the character to see if it '0' thru '9' If it isn't, tell user it's not an integer.

Member Avatar for WaltP
0
141
Member Avatar for Shillz

[QUOTE=Shillz;1018265]how can we use a printf statement without a semicolon??? this was a question asked during an interview of a computer engineering student.[/QUOTE] Assuming this was a job interview, I suggest you stay away from any job that asks foolish questions like this. I would not want to work for …

Member Avatar for Shillz
0
153
Member Avatar for dp20

[QUOTE=dp20;1095854]How do I do that?[/QUOTE] Let me count the ways: 1) in [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies]the Rules[/url] you were asked to read when you registered 2) in the text at the top of this forum 3) in the announcement at the top of this forum titled [url=http://www.daniweb.com/techtalkforums/announcement8-3.html]Please use BB Code and Inlinecode tags[/url] …

Member Avatar for WaltP
0
567
Member Avatar for caroll
Member Avatar for Ihatepullups

To compare a character value, use the character. Single quotes around a single character is what you need: [icode]if (chr == 'y')[/icode] And remember, 'Y' and 'y' are [I]not[/I] the same values... For comparison, double quotes go around a [I]string[/I] (or multiple characters): [icode]"This is a string"[/icode]

Member Avatar for niyasc
1
109
Member Avatar for lonelyday91

Being a human and not a computer, it helps to give details. What is input? What should be output? What is actually output?

Member Avatar for lonelyday91
0
85
Member Avatar for a7med sh

[QUOTE=a7med sh;1095295]can any 1 help me with that !! plz[/QUOTE] Yes, of course. As you know by reading the forum rules and the sticky posts at the top of the forum you forgot to post a few things with your request. Keep in mind every letter has a distinct numeric …

Member Avatar for WaltP
0
87
Member Avatar for master_ref

The End.