5,676 Posted Topics
Re: [QUOTE=Sturm;475190]So I guess it's somehow [I]my[/I] problem?[/QUOTE] No necessarily [I]your[/I]s. It's probably Opera's. | |
Re: Neither do we. You didn't tell us why you think it's wrong. Did you miss the post titled [url=http://www.daniweb.com/techtalkforums/thread78223.html][b]Read Me:[/b] Read This Before Posting[/url]? | |
Re: [QUOTE=wambooman;475220] What happens is that the getline gets the information from the previous cin. so say I cin hello world hello world, my cout will give me world~10hello~10world+garbage. any reasons why?[/QUOTE] There is no previous [ICODE]cin[/ICODE] so we can't tell. We also don't know whether [I]SA[/I] is a c-string, C++string, … | |
Re: Depends on the reason. If you want to play it, read it with an .avi player, like Windows Media Player. If you want to look at the totally unreadable contents (except the header), open it as a binary file and read it as bytes. | |
Re: [QUOTE=danejar;470243]Hello, I don't know bandit_77, but I am also trying to write the exact program that he requested help on. I doubt I know as much as the original poster because I am very new to programming. So the answer to the "goldilocks" problem is, ""Woah, back up Einstein, I'm … | |
Re: [QUOTE=brlukosk;474667]Hello all! New here at daniweb. I am working on a function to check the validity of a sudoku puzzle. It must check the 9x9 matrix to make sure it follows the rules and is a valid sudoku puzzle. this is what I have come up with so far: ... … | |
Re: Another thing to consider, what if the user enters 15 characters? All you read are the first 9 and he thinks his password is longer than it is. You should probably accept more characters and give an error if 10 or more are entered. | |
Re: Search the string for the character. If found, replace the character with '\0'. Ta Daaaa! | |
Re: If you learn now to [url=http://www.gidnetwork.com/b-38.html]format your code[/url] you will discover it's easier to find errors and your code will be easier to read. This is [I]very[/I] worthwhile when you get to more complex programs. It also helps us understand your code. | |
Re: [QUOTE=xeto;474220]I have a palindrome program.Is there a way to ensure user input terminated in a string by a punctuation mark (e.g. ‘!’, ‘.’, or ‘?’.) in an array? [/QUOTE] Get the length or the string, check the last character with the function [ICODE]ispunct()[/ICODE] [QUOTE=xeto;474220]And how do i get the program … | |
Re: On [I]what[/I] above? There is no post above this one! And try reading the RULES as recommended multiple times during your registration here, as well as the post at the top of the forum clearly titled "[I][b]Read Me:[/b] Read This Before Posting[/I]". Notice the wording -- [B]before posting[/B]. | |
Re: Turbo C Ver 1 also prints, so it's probably a bug at least through ver 3. Borland 5.5 works as expected. | |
Re: I don't see a program, therefore there's nothing to help with. | |
Re: [QUOTE=Dvb701;474034]i cant seem to figure out how to write the void function void (searchRecords() ) of Search for matching records tried numerous things, what i need it to do is just search for a record and display it to the user how many matches found, thanks in advance for any … | |
Re: Please post [url=http://www.gidnetwork.com/b-38.html]formatted code[/url] so it can be followed and understood. It will help you in the long run. | |
Re: [QUOTE=Butterflieq;473247]When writing my pseudocode I declare my variables in a module called housekeeping(). We are currently working on reading input from a file or files rather than asking the user directly for input. I am a bit confused how this might work with my pseudocode though. I know how I … | |
Re: [QUOTE=sugarflaps;473454]Hi It does compile but it doesnt do what i want it to do i want to create a 2d array using the black and grey blocks from the ascii code with each dn value being either grey or black.[/QUOTE] Most of us aren't psychic here. You need to tell … | |
Re: [QUOTE=Duoas;472960]There is nothing wrong with using a system program to clear the screen. It is simple and you can count on "cls" or "clear" being present on most systems. [/QUOTE] Totally disagree. #1) [I]Which[/I] is it going to be? And how do you write portability with multiple choices like this? … | |
Re: Please read the rules as suggested when you registered so you can post an intelligently worded question. And based on [url=http://www.daniweb.com/forums/post473329.html#post473329]this post[/url] you can probably figure out what the answer is... :icon_rolleyes: | |
Re: Start a loop Output the menu Accept the selection Based on the selection, do the appropriate task. (Don't forget an exit selection) End of loop Did you bother to read the rules, especially the CODE TAG information? | |
Re: Many of those errors are self explanatory. Fix those first. | |
Re: [QUOTE=kiel19;472922]teach me how to format my program befor posting[/QUOTE] [url=http://www.gidnetwork.com/b-38.html]Here you go[/url] You might also try the post titled [url=http://www.daniweb.com/techtalkforums/thread78223.html][b]Read Me:[/b] Read This Before Posting[/url] as well as [url=http://www.daniweb.com/techtalkforums/announcement8-3.html]this announcement[/url] | |
Re: In addition to what [B]Salem[/B] suggests, define [I]optimized[/I] in your context. | |
Re: Read your textbook. It's in there. | |
Re: Yes, it's a plan. It's basically like a blueprint that you follow to actually write the program. It makes programming easier and faster. | |
Re: How many times during registration were you pointed to [I]The Rules[/I]? Why would you ignore them? When reading an integer, [ICODE]cin[/ICODE] leaves the \n in the buffer. The next [ICODE]cin[/ICODE] sees that and continues on thinking it was his. You have to clear the input stream before reading strings if … | |
Re: Also: [ICODE]#include<iostream.h>[/ICODE] -- old header that shouldn't be used for the past umpteen years [ICODE]#include<conio.h>[/ICODE] -- header that should not be used as it's not portable [ICODE]void main()[/ICODE] -- [I]main()[/I] has NEVER been a [I]void[/I], always an [I]int[/I], [url=http://www.gidnetwork.com/b-66.html]see this[/url] [ICODE]clrscr();[/ICODE] -- useless function only defined in 1 old compiler, … | |
Re: [QUOTE=towhoe260;472358]How do i go about getting a table in there. we have not covered this in class.[/QUOTE] Then it's not something you want to do. It's not easy at your level of experience. | |
Re: Stop using the type [I]double[/I] everytime you reference a variable. Once you say[ICODE]double varname[/ICODE] you only need to use [ICODE]varname[/ICODE] from that point on. | |
Re: Also: [ICODE]#include<iostream.h>[/ICODE] -- old header that shouldn't be used for the past umpteen years [ICODE]#include<conio.h>[/ICODE] -- header that should not be used as it's not portable [ICODE]void main()[/ICODE] -- [I]main()[/I] has NEVER been a [I]void[/I], always an [I]int[/I], [url=http://www.gidnetwork.com/b-66.html]see this[/url] [ICODE]clrscr();[/ICODE] -- useless function only defined in 1 old compiler, … | |
Re: After you check the root, you have to check the next node. If less, move left, if greater, move right. Check that node. If less... ad nauseum... until you run into your -1. [I]That's[/I] where the new node goes. | |
Re: [QUOTE=delacruise;470219]i got an issue of creating a QUEUE of integers in a circular array using C to insert, remove, display, show CAN ANYBODY HELP ME OUT HERE[/QUOTE] In the [I]Community Feedback[/I] forum? I don't think so... Can't you find a better place to post this question? | |
Re: [QUOTE=holy_boy;471424]I may ask something else later so I m not marking it as solved as I may have further problems.[/QUOTE] When you do, please consider [url=http://www.gidnetwork.com/b-38.html]formatting your code[/url]. It will help you in the long run. It will help us in the short run. :icon_wink: | |
Re: Have you bothered reading [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies]the Rules[/url] and [url=http://www.daniweb.com/techtalkforums/thread78223.html][b]Read Me:[/b] Read This Before Posting[/url]? This was suggested multiple times when you registered. ![]() | |
Re: [QUOTE=danbellinger1;471220]No dice. Is there a header I need to include?[/QUOTE] Headers don't [I]do[/I] anything. The problem is [ICODE]cin[/ICODE] [I]requires[/I] input when you specify a variable. You can't enter nothing. Using [ICODE]cin.getline()[/ICODE] will work, though. | |
Re: Yes, we can help, once you've read the rules as you were asked many times diring your registration process. | |
Re: [QUOTE=Barefootsanders;470768]sorry, I should have said I changed it to this, [CODE] char *getString(char *string) { scanf("%199s",string); return string; }[/CODE] to provide for the null char. Thanks again:)[/QUOTE] We still recommend: [CODE] char *getString(char *string) { [B]fgets(string, 200,stdio);[/B] return string; }[/CODE] It's just too easy to make a mistake with [ICODE]scanf()[/ICODE]. … | |
Re: [QUOTE=webster22;470620]Hi, i have to programm this in c++ can anyone please help me and give me the code for this... IF SOME ONE CAN HELP ME WITH THIS AND SEND ME THE CODE I WILL BE VERY GREATFULL TO THAT PERSON.[/QUOTE] So you just want to be lazy and have … | |
Re: First of all, please learn to [url=http://www.gidnetwork.com/b-38.html]format your code[/url]. Are you trying to add all the [I]i*j[/I] values together? If so, all you did is add the very last [I]i[/i] and [i]j[/I] values based on the loops. That's going to be 9+9 = 18. You need to add [I]i*j[/I] to … | |
Re: Maybe it would help to ask the person that actually wrote the code for you than having us try to figure out what he meant when he wrote it. | |
Re: I'm confused, too. Confusion #1: Why don't new posters ever read the post [url=http://www.daniweb.com/techtalkforums/thread78223.html][b]Read Me:[/b] Read This Before Posting[/url]? Isn't the title explicit enough? Confusion #2: No idea what your problem is. I have no idea what "[I]I donot see how to read 3 separate values, store them but not … | |
Re: Yes, [ICODE]getline [/ICODE]is correct. and use [ICODE]string[/ICODE]. It has [I]find[/I] and [I]substring[/I] functions that will help split the string into values. | |
Re: [url=http://www.gidnetwork.com/b-38.html]Format!!! Format!!! Format!!![/url] Please!!! You need [icode]srand()[/icode] to initialize the random generator (use once at the program's start) and [icode]rand()[/icode] to get a random value. And where is your [I]shuffle[/I] routine? | |
Re: First of all, [url=http://www.daniweb.com/techtalkforums/thread78223.html]read this[/url]. Then explain what your problem is, don't make us try to guess. And be patient. We all have lives and don't live here at DaniWeb -- 13 minutes is not an appropriate length of time to get demanding. | |
Re: The same way you do it by hand. You just have to tell the computer every step you did by hand in minute detail. | |
Re: [QUOTE=superrg86;470514]I need to do a stack of strings but im getting problems can anyone help ... The errors im getting: Error 1 error C2440: 'initializing' : cannot convert from 'std::string' to 'size_t' g:\pf iii\stacks\stacks\stack.cpp 23 [/quote] [ICODE]stackArray = new string[value];[/ICODE] [I]String[/I] is not an array, and [I]value[/I] is not a … | |
Re: [QUOTE=balla4eva33;470091]Let me correct my last post. It says that the 'read' does not take [B]1[/B] parameter. I assume that means I need something like [B]infile.read(text, ios::binary);[/B][/QUOTE] This is why we ask you to paste the [I]exact error message[/I] rather than post your interpretation of the message :icon_wink: Since I just … | |
Re: [url=http://www.gidnetwork.com/b-44.html]This may help[/url]. |
The End.