5,676 Posted Topics
Re: [QUOTE=Lightning03;1713653]We are having problem with our code regarding file streaming.[/quote] No, you are having problems with your code because you are doing [I]very bad things[/i]: [ICODE]void main()[/ICODE] -- MAIN is and always has been an [b]int[/B] function. [url=http://www.gidnetwork.com/b-38.html]See this[/url]. [ICODE]exit(1);[/ICODE] -- is there something wrong with a simple [ICODE]return(1)[/ICODE]? [ICODE]system("Pause");[/ICODE] … | |
Re: and where do you get the [iCODE]ln()[/iCODE] function? From [I]math.h[/I]? Which can't be used? | |
Re: The first question: this isn't a question. Did you leave something out? The second question: what do [B]you[/B] think the answer is? You give us your answers and we can confirm if you are correct, but we won't do your homework for you. | |
| |
| |
Re: [QUOTE=MandrewP;]Regardless of what the author of this code intended, what it actually does is this: This function fo() prints out the value of count, and the value of count will be increased by 1 if it is less than 5 or else it will be increased by 2 if it … | |
Re: I'm not sure I understand... your first post seem to say 1) You want to make sure your sorts are stable. 2) You run both sorts on data and find out they [I]are[/I] stable. 3) The code works for your test so far. So what is your question? Try more … | |
Re: Try passing "[I]a 2-D array a size for the number of[/I]" rows, not columns | |
Re: Never define variables in a header file (.h) They go into source files (.c) | |
Re: Looks like an interesting project. Good luck. | |
Re: [b][boilerplate_help_info][/b][code] Posting requests for help must be well thought out if you want help quickly and correctly. Your post did not meet the criteria for quality help. You may get some posts, but are they going to be useful? Check your post with these checkpoints - what is it [i]you[/i] … | |
Re: Then find a compiler that [I]has[/I] documentation. | |
Re: [B]First[/B] things first... Get rid of *ALL* [iCODE]system()[/iCODE] calls. Clearing the screen is not necessary. Calling the operating system command PAUSE is bad. If you want to pause the game, just do a [iCODE]cin[/iCODE]. It's part of the language. [B]Second[/B] (you may as well learn this now rather than pull … | |
Re: Sure. Read the file until you get to the '[I]certain start line[/I]'. Then continue reading and doing what you need to do with each line. When you reach the '[I]certain end line[/I]', stop reading. | |
Re: [QUOTE=Taino;]Hi, I am trying to complete this application. just using a simple Array. I have most of the instructions down and included some additional stuff I thought was practical; it seems to work up to a point. I will continue to explain. [/QUOTE] But you didn't continue. All you did … | |
Re: Three programmers were walking down the street. Two of them walked into a bar. The third sidestepped it, laughing. | |
Re: [iCODE]getche()[/iCODE] is a non-standard function and should not be used at all. They are trying to keep the program window open when you execute the code using the IDE. It's best to use a standard C function (like [iCODE]getchar()[/iCODE]) for that. [iCODE]return 0;[/iCODE] is required because [iCODE]main()[/iCODE] is an integer … | |
Re: Read the list 1 value at a time Put them in the array where you need them to go. [b][boilerplate_help_info][/b][code] Posting requests for help must be well thought out if you want help quickly and correctly. Your post did not meet the criteria for quality help. You may get some … | |
Re: Take all inputs as a character string. Then test the characters to make sure they fit your required input. If not, display an error; if so, convert to integer and continue. | |
Re: Sure we can help. But with no effort shown on your part so far, all we can do it write it for you. If you need help you will have to give us something to help with. | |
Re: I suspect if you properly [url=http://www.gidnetwork.com/b-38.html]format your code[/url] an error will show itself. I think because of bad formatting, your 4 nested [iCODE]for()[/iCODE] loops are causing a problem. | |
Re: [b][boilerplate_help_info][/b][code] Posting requests for help must be well thought out if you want help quickly and correctly. Your post did not meet the criteria for quality help. You may get some posts, but are they going to be useful? Check your post with these checkpoints - what is it [i]you[/i] … | |
Re: [QUOTE=sundip;1710636]Use while (!myInfile1.eof()) in place of line 35 and also close file handler at line 70) myInfile1.close();[/QUOTE] No, don't. [url=http://www.gidnetwork.com/b-58.html]Here's why[/url] ([ICODE]feof()[/ICODE] is the same as [ICODE].eof()[/ICODE] | |
Re: [QUOTE=coolbeanbob;]I've narrowed the problem down to line 82, which is trying to read an array with an index out of the array range. I know this is a problem, but I would expect to see a garbage number displayed on the console and not my computer losing it.[/QUOTE] Your computer … | |
Re: Use the program [B]Visual-C++ Express[/B]. It's free. | |
Re: So what's the problem? What you have (with the bare description) looks OK so far. | |
Re: Also, have you ever heard of SPACEs? Your blob-of-text format is very difficult to read. Take this blob: [CODE] int month,mth,yr,cen,day, year,dow; string name; getInput(month,day,year); mth=getMonthValue(month, year); yr=getYearValue(year); cen=getCenturyValue(year); dow=(day+mth+yr+cen)%7; switch(dow) { case 0: name="Sunday";break; case 1: name="Monday";break; [/CODE] (where'd that space come from at [iCODE]day, year[/iCODE]) :icon_wink: Reformatted so … | |
Re: [QUOTE=zizuno;1711008]Correct me if I'm wrong, but crtl + x isn't z.[/QUOTE] I find it interesting that when people are right, they say "[I]Correct me if I'm wrong, [/I]" but when they in fact are wrong, they write their information as if it was a fact. Just something I notice... :icon_wink: | |
Re: Set up a while loop that finds the largest digit in [I]num[/I] and creates [I]sorted[/I]: [CODE] save num for later in numSave; set smallest to 10 Loop until num = 0 get last digit (%) remove last digit (/) if digit > smallest, replace smallest [/CODE] Now remove that [I]digit[/I]: … | |
Re: [QUOTE=Ancient Dragon;]Both issues can be solved at the same time by calling memset() to flood the array with '\0' bytes. [code] p = malloc(n+1); // make room for null-terminating character memset(p,0,n+1); // initialize the array [/code][/QUOTE] or a simple loop [ICODE]for (i=0; i<n+1; i++) p[i] = 0;[/ICODE] which is most … | |
Re: Start by [url=http://www.gidnetwork.com/b-38.html]formatting the code[/url] so we can follow it. | |
Re: What are you attempting to do with [iCODE]Customer.substr(currentcount,Customer.length()-currentcount+1);[/iCODE]? It looks like you get the substring but you don't do anything with it. Is there an = missing? | |
Re: [QUOTE=Tom_Weston;]Hi, I'm wondering how to remove a specific part of a string.. Thank you, I am still learning, but also getting the hang of strings as I work this more![/QUOTE] [QUOTE=Tom_Weston;]Heres the thing, I don't want to remove part of the string with values (example +1, -7). Isn't there a … | |
![]() | Re: [QUOTE=jmichae3;]also, I can understand what CODE is, but I don't think *anybody* has even a clue what ICODE means. [/QUOTE] I do. And I use it correctly, and often, too... :icon_wink: |
Re: Use google. Find out how a trig function is calculated in the real world. Then once you find that, convert the equation into code. | |
Re: [QUOTE=itzcarol;]Do you know how to delete this thread?[/QUOTE] Why? | |
Re: Based on the information you've provided, the easiest "[I]database[/I]" for your data is a standard text file. Each line in the file contains [I]employee name, age, contact number[/I] in a fixed format, say char name[20]; int age; char contact[10]; Read the entire file into a structure array and process with … | |
Re: So far, so good. You might want to [url=http://www.gidnetwork.com/b-38.html]format your code[/url] so we can read it easier next time you post. | |
Re: [QUOTE=omer620;]Hello guyz how r u all[/quote] Annoyed at people that use leet speek on a professional programming forum, which is against the rules. [QUOTE=omer620;]i m new in programming[/quote] So? We all were. [QUOTE=omer620;]can u help me plzz[/quote] You must be a certain age to be a member here, and this … | |
Re: Two possibilities: Find the '.' and remove it. Reverse the number. Add the '.' back in. Reverse the value. If the '.' is not in the proper position, switch characters until it's in the correct position. I.E., If your number reversed is 52.1232 switch the dot giving 521.232 and switch … | |
Re: If at first you don't succeed, do a statistical analysis to correct the results. | |
Re: Why are you reading an [B]int[/B] (ch) and testing as a character? It should be defined as a [B]char[/B]. What does [B]letters[/B] do in your code if you increment it then immediately set it to 0? Also [url=http://www.gidnetwork.com/b-58.html]see this[/url] ([iCODE]feof()[/iCODE] is identical to [iCODE].eof()[/iCODE]) and [url=http://www.gidnetwork.com/b-61.html]this[/url] and [url=http://www.gidnetwork.com/b-38.html]this[/url] [quote=Schoil-R-LEA][b]EDIT:[/b] I … | |
Re: [QUOTE=zeroliken;][QUOTE]Do not ask for code. We are not a coding service. We will help you fix your code. If anyone posts a complete working solution for you, they are enabling cheaters. If you use that code you are a cheater. [/QUOTE][URL="http://www.daniweb.com/software-development/c/threads/78060"]Read me[/URL][/QUOTE] If you are going to quote the [B]BoilerPlate[/B], … | |
Re: Help with what? A description of the problem isn't a question. | |
Re: [b][boilerplate_help_info][/b][code] Posting requests for help must be well thought out if you want help quickly and correctly. Your post did not meet the criteria for quality help. You may get some posts, but are they going to be useful? Check your post with these checkpoints - what is it [i]you[/i] … |
The End.