5,676 Posted Topics
Re: 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] | |
Re: [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. | |
Re: 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 … | |
Re: What input functions are available with ncurses? | |
Re: 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 … | |
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 … | |
Re: Because that's not how C++ was defined. | |
Re: Do you know how to write to a file? That's pretty much all you need to know. | |
Re: use [B]Wine[/B]? | |
Re: Somebody forgot to read the Forum Rules as requested multiple times upon signing up. | |
Re: Maybe a "Disk Controller"? Or maybe "A Board that breaks my computer when it's removed"... | |
Re: 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. | |
Re: 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. | |
Re: [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. | |
Re: 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! | |
Re: [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: | |
Re: [center][B]Sign at the End of the Universe[/B] thanks to a story by [I]Duane Ackerson[/I] (1974) [/center] | |
Re: By keeping track of your spacing with a variable. | |
Re: 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. | |
Re: [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 … | |
Re: Or loop through the 'char' and use the [iCODE]num = (num * 10) + char[/iCODE] process. | |
Re: My guess, since you didn't post any actual code, is you're reaching [iCODE]G>291[/iCODE] and/or [iCODE]L>2[/iCODE] | |
Re: Can you hide the CANCEL button? If so, process Cancel code using the OK button. | |
Re: 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 … ![]() | |
Re: 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. | |
Re: 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]. | |
Re: He left his email right there on the page you linked to. Try that. | |
Re: [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. | |
Re: 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. | |
Re: [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. | |
Re: Another suggestion: [url=http://www.gidnetwork.com/b-38.html]format[/url] your code better. Indents are too deep and not consistent. | |
Re: [url=http://www.gidnetwork.com/b-38.html]FORMAT FORMAT FORMAT[/url]!!! | |
Re: [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: | |
Re: [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... | |
Re: 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... | |
Re: [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 … | |
Re: 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 … | |
Re: [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] … | |
Re: 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. | |
Re: [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 … | |
Re: [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] … | |
Re: 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] | |
Re: Being a human and not a computer, it helps to give details. What is input? What should be output? What is actually output? | |
Re: [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 … | |
Re: In gcd() you return [B]v[/B], but that's the value you passed into the function unchanged. |
The End.