5,676 Posted Topics
Re: DevC++ works for most people here. Are you absolutely sure your code compiles without errors? | |
Re: Also, please read [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies#faq_keep_it_organized]this[/url]. Your titles are worthless as they are. This thread should be titled something like "[I]Using user32.dll with Dev-C++[/I]" | |
Re: Since it helps to explain [I]what[/I] is wrong instead of just tossing new unexplained code at you, here's what's wrong with your code: [code=c] my code: #include<time.h> int main() { // first of all, why isn't the following indented? int num[50]; int x,odd,even; srand(time(NULL)); for(x=0; x<50; x++) { num[x] = … | |
Re: You seem to have been here long enough to know better than post a title like this. [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies#faq_keep_it_organized]See the Rules[/url]. In looking at your list of threads, STOP using noob/newbie/etc in the title!!! Just use a good name!!!! | |
Re: [QUOTE=rajatC;492243]plz comment...[/quote] OK, here goes: 1) No CODE tags -- they are mentioned in [B]The Rules[/B] as well as all over the site. Even where you typed in your post. 2) English!!!! i m -- I'm u -- you dont -- don't plz -- please also mentioned in [B]The Rules[/B]. … | |
Re: Also, you don't have to announce you're a newbie with every thread title. Just title the questions with good titles like you have been doing. | |
Re: So use cin.get() after a prompt that states "Press RETURN to end" | |
Re: Only one thing... it isn't keeping it from working, but it is a little annoying. After entering the text into the program, I hit enter and it takes the blinking curser to the next line and does nothing. I have to hit enter a 2nd time to get it to … | |
Re: Look carefully at this section of your code: [CODE] if (x<10&&x>20) x=z%10; if (x==1) printf(" one"); ... [/CODE] You also might want to consider using more spaces in each line to make the code more readable. Something like: [code] z = num % 100; if (z >= 20 && z … | |
Re: In other words, the address from the [ICODE]new[/ICODE] is loaded into [I]pstr[/I]. This buffer is not local to the function, only [I]pstr[/I] is local. When you return, the variable [I]pstr[/I] is destroyed, but the contents (the address of the [ICODE]new[/ICODE] buffer) is returned. That buffer is not destroyed. | |
Re: Without even looking I'll bet [url=http://www.gidnetwork.com/b-58.html]this will help[/url] -- [ICODE]feof()[/ICODE] and [ICODE].eof()[/ICODE] are identical. | |
![]() | Re: [QUOTE=johny112;489598]thanks for reply, it works fine but theres a couple more things: 1) how to i calculate the number of of comparisons made and then print it?[/quote] Set a value to 0 before the loops and increment it immediately before the comparison. When the loop is done, output it. [QUOTE=johny112;489598]2)im … |
Re: [B]Mr. Cool[/B], what do you do when you have to run the program on a system that does not have the CLS operating system command? Here at [B][I]DaniWeb[/I][/B], we try to give help that doesn't rely on system-specific solutions. Solutions that can work for as many people as possible. | |
Re: If the nodal name is a [I]string[/I] type, you can simply add "_info.txt" to it to create the file name. Open and output the rest of the line. Close the file. Read the next nodal name. | |
Re: You can't compare the string [I]player->GetGold[/I] with an integer. If that doesn't solve the problem, give us the information we need to [I]understand[/I] the problem. Try reading the sticky posts at the top of the forum for some suggestions. | |
Re: [QUOTE=Ancient Dragon;488202]you mean in the old ancient Turbo C ? You can't. Get a newer compiler that supports such things.[/QUOTE] Sure you can. What do you think they [I]did[/I] way back then? Use a time machine to get today's compilers to read an image file? :icon_wink: [B]safira[/B], depends on what … | |
Re: Have you read [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies#faq_keep_it_organized]this[/url] or [url=http://www.daniweb.com/techtalkforums/thread78223.html]this[/url] yet? | |
Re: [QUOTE=chubbs1900;487819][CODE]int anyPositiveEOF (void) { int anyPositive = 0; int numIn; int counter; for ( counter = 0; cin >> numIn; counter++ ) if ( numIn > 0 ) anyPositive += numIn; else return -1; return anyPositive / counter; }[/CODE] This what you mean?[/QUOTE] How do you exit the loop when … | |
Re: [QUOTE=kevinpovec;487590]thank you for the advice. i got it working just fine now. still getting used to the mod function. never saw it before this semester. i used this code to get it to work for anyone else who happens to have a similar problem [code] if (num <= 5000) { … | |
Re: [QUOTE=Dean_X;482376]You are kidding, right? [/QUOTE] Kidding about what? I don't understand what you mean. Let's look at what [B]Lerner[/B] said: [QUOTE=Lerner;482347]Your code is almost impossible to read due to poor formatting. Learning how to format with consistent and appropriate indentation will save you lots of time trying to debug and … | |
Re: [QUOTE=iamthwee;487003]My guess is that you are [icode]couting[/icode] a variable that has yet to be initialised to some arbitary value.[/QUOTE] Actually, you may be [ICODE]cout[/ICODE]ing a variable that has an arbitrary value, and you should initialize it to a [I]specific[/I] value. | |
Re: [QUOTE=Duoas;458567]Yeah. As far as I am concerned, the computer is there to serve [I]me[/I], not the other way around. ;) [/QUOTE] Then why are you using WinBlows? :icon_twisted: | |
Re: First of all, your formatting is fairly good, just a tad inconsistent. Be a little more careful with your indentation. The concept of mastermind is almost identical to the game Lingo if you get the cable station GSN (Game Show Network). After the user enters his guess, you need to … | |
Re: Try using [icode]strstr()[/icode] to search for [I]the[/I]. Keep in mind that [B]The[/B] and [B]the[/B] are not the same because of the first letter. | |
Re: Yep. [url=http://www.gidnetwork.com/b-58.html]See this[/url] | |
Re: Why would you type [I]forum[/I] when there's more than one? :?: | |
Re: Not really a problem, but your prototypes don't need [B][4][/B]. They can be specified as: [code]bool checkRows ( int theSquare[][], const int numRows, const int magicValue ); bool checkColumns ( int theSquare[][], int const numRows, const int magicValue); bool checkDiagonals (int theSquare[][], const int numRows, const int magicValue); bool checkRange … | |
Re: Narue, how can you put cplusplus sysntax highlighter in your post? > [code[B]=cplusplus[/B]] > [I]your code here[/I] > [/code] Isn't that on the background of the textbox in which you entered the question? | |
Re: The SPACEs in the scanset seem to be the problem. Remove them and see if that works for you. Also, check out this information on [url=http://www.gidnetwork.com/b-66.html]main()[/url] [url=http://www.gidnetwork.com/b-58.html]while (! feof(in))[/url] And what is the purpose of reading the file first? Just read it once. I would also suggest rather than using … | |
Re: Using [url=http://www.gidnetwork.com/b-38.html]proper formatting[/url] helps solve problems like this... | |
Re: A few comments on the code: 1) Please use [url=http://www.gidnetwork.com/b-38.html]better and consitant formatting[/url] so the program can be understood. It help both you and us. 2) [ICODE]getch()[/ICODE] and [ICODE]conio.h[/ICODE] -- They are not standard and you don't need them. [ICODE]cin.get()[/ICODE] is standard and does what you need. 3) [ICODE]void main()[/ICODE] … | |
Re: Someone forgot the CODE tags that were mentioned in the Rules you read when you registered. Not only that, you typed right over exactly how to use them when you entered your message. It helps us help you if you try harder. You also neglected to [url=http://www.gidnetwork.com/b-38.html]format your code[/url]. This … | |
Re: [QUOTE=cs378;482467]Child 1 opens the file and read a character, it then passes the a character to Child 2. Child 2 now take the received character and writes it a file. Child 1 stops reading when the read is EOF. Child 2 stops writing when it receives a '\0'. Thank You … | |
Re: Did you miss the request to read the Rules when you registered? Did you also miss the post [COLOR="Red"][b]Read Me:[/b] Read This Before Posting[/COLOR]? What could we have done to have you understand the importance of reading this information? | |
Re: Please learn to [url=http://www.gidnetwork.com/b-38.html]format your code[/url] better so we can read it. Pay attention to the [I]Indentation[/I] section. Look at the parameter types in the function call you're having trouble with. What are the variable types the function expects, and what are the variable types you are passing? | |
Re: [QUOTE=jasssvj;343587]Hi! I have to make a program, wich lists all files in current dir, and then save all file names into an array. My program doesn't work ! Can you tell me why?[/QUOTE] You need to tell us why you think it's wrong? We don't know the symptoms you're seeing. … | |
Re: Read [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies]the Rules[/url] as you've been asked, and the post titled [url=http://www.daniweb.com/techtalkforums/thread78223.html][b]Read Me:[/b] Read This Before Posting[/url]. | |
Re: [B]tarekkkkk[/B], please use full English so we can all understand you. Don't use web-speak because a lot of people here don't understand it. | |
Re: [QUOTE=cl3m0ns;482793]Thanks for that but do you know how to write the information into an array? Or for that matter how to split this string into individual parts for the structure?[/QUOTE] Yes. But it depends on lots of things -- format of the file, what the array looks like, what delimiters … | |
Re: [QUOTE=cl3m0ns;482795]I was just trying to figure out how powerful or useful pointers are because they just seem worthless to me...thanks for your help though.[/QUOTE] Then you simply don't know enough of the language yet. The knowledge and understanding will come. You don't need to rush it yet. | |
Re: First things first: [url=http://www.gidnetwork.com/b-38.html]Format your code[/url] [QUOTE=zandiago;465792]2. Remove all the duplicate letters in the key phrase.[/quote] Nested loops.... Replace any duplicates with SPACEs. When done, compress the SPACEs out. [QUOTE=zandiago;465792]3. Remove the letters that remain in the edited key phrase from the string of the 26 alphabet letters.[/quote] This one … | |
Re: Yes, most of us can answer [I]the[/I] question -- if there was one. There was not one :icon_question: in the entire post, so no question was asked. On the other hand, if the question was actually implied and was "can someone write code from this problem description" the answer is … | |
Re: [url=http://www.daniweb.com/techtalkforums/thread78223.html]this[/url] and [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies]this[/url] will help | |
Re: [QUOTE=mastro;476647]Dear salem ; the first " Thank you " but sorry salem this must be submit [COLOR="red"] " phase1(due 25/11/07), you are required to submit the initial user interface and the UML notation [using Rational rose ] of basic classes "[/COLOR] and ... etc plezz help me[/QUOTE] I don't understand. … | |
Re: What values are in the [ICODE]compe[/ICODE] array? | |
Re: [QUOTE=Ancient Dragon;481465]Is using '#' to deliniate lines required by the assignment or is it something you dreamed up on your own? [code] while( cin >> name >> street >> city >> state >> zip) { } [/code][/QUOTE] Will that work for: [I]John Smithers 2031 West Alberta Street Sioux Falls South … | |
Re: [QUOTE=Randgalt;481348]I have an implementation here: [url]http://sourceforge.net/projects/kwaymerge[/url][/QUOTE] I'm sure after 2 1/2 years the OP will be ecstatic to hear that. :icon_rolleyes: | |
Re: How can in "play havoc" when 0.0000517 is almost 0.00? They are essentially the same. I suggest it's how you are using 0, not the fact that it's a minuscule number. | |
Re: Are we supposed to guess which line out of 95 the error occurs on? We have slightly more than a 1% chance of that... :icon_wink: | |
Re: Better yet, look at gabbly.com. As it says on the homepage, [quote]Just add 'gabbly.com/' in front of any URL[/quote] and you can chat with whomever does the same thing... |
The End.