5,676 Posted Topics

Member Avatar for king03

[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] …

Member Avatar for WaltP
0
226
Member Avatar for tformed
Member Avatar for mikrosfoititis
0
1K
Member Avatar for devianleong

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.

Member Avatar for sufyan2011
0
113
Member Avatar for eagles39
Member Avatar for theUserMan
Member Avatar for AlvinLiu

[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 …

Member Avatar for MandrewP
0
187
Member Avatar for challarao

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 …

Member Avatar for WaltP
0
323
Member Avatar for qmanchoo
Member Avatar for WaltP
0
184
Member Avatar for BlZbB
Member Avatar for WaltP
0
258
Member Avatar for harde
Member Avatar for gourav1

[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] …

Member Avatar for mikrosfoititis
0
254
Member Avatar for jemz
Member Avatar for sum337

[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 …

Member Avatar for WaltP
0
3K
Member Avatar for vyrte

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.

Member Avatar for WaltP
0
168
Member Avatar for Srinivas0
Member Avatar for Taino

[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 …

Member Avatar for WaltP
0
394
Member Avatar for peter_budo

Three programmers were walking down the street. Two of them walked into a bar. The third sidestepped it, laughing.

Member Avatar for WaltP
0
141
Member Avatar for twistercool

[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 …

Member Avatar for Moschops
0
277
Member Avatar for iffrah

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 …

Member Avatar for WaltP
0
164
Member Avatar for rjstamey

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.

Member Avatar for WaltP
0
107
Member Avatar for jpherrera241982

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.

Member Avatar for sufyan2011
0
340
Member Avatar for EXpoZuR

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.

Member Avatar for EXpoZuR
0
219
Member Avatar for mits28

[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] …

Member Avatar for WaltP
0
112
Member Avatar for Xaviorin

[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]

Member Avatar for Xaviorin
0
239
Member Avatar for coolbeanbob

[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 …

Member Avatar for WaltP
0
151
Member Avatar for azuresapphic88
Member Avatar for abhilash mohan
Member Avatar for EXpoZuR

So what's the problem? What you have (with the bare description) looks OK so far.

Member Avatar for EXpoZuR
0
220
Member Avatar for Thermalnuke

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 …

Member Avatar for WaltP
0
188
Member Avatar for MediumSoda

[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:

Member Avatar for MediumSoda
0
441
Member Avatar for easterbunny

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]: …

Member Avatar for easterbunny
0
2K
Member Avatar for rockerjhr

[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 …

Member Avatar for Narue
0
128
Member Avatar for mahavairavan
Member Avatar for Tumlee
0
1K
Member Avatar for Xaviorin

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?

Member Avatar for Xaviorin
0
127
Member Avatar for Tom_Weston

[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 …

Member Avatar for Xaviorin
0
381
Member Avatar for jmichae3

[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:

Member Avatar for Dani
0
274
Member Avatar for Ancient Dragon
Member Avatar for momin90909

Use google. Find out how a trig function is calculated in the real world. Then once you find that, convert the equation into code.

Member Avatar for WaltP
0
276
Member Avatar for itzcarol
Member Avatar for c fan

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 …

Member Avatar for Ancient Dragon
0
240
Member Avatar for mc3330418
Member Avatar for iGuardian

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.

Member Avatar for WaltP
0
137
Member Avatar for mazdasa
Member Avatar for omer620

[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 …

Member Avatar for ppt123
0
237
Member Avatar for Assassin7893

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 …

Member Avatar for Assassin7893
0
865
Member Avatar for Tim Elsky

If at first you don't succeed, do a statistical analysis to correct the results.

Member Avatar for Agilemind
0
178
Member Avatar for Thermalnuke

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 …

Member Avatar for Thermalnuke
0
167
Member Avatar for mridul.ahuja

[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], …

Member Avatar for mridul.ahuja
0
4K
Member Avatar for aphide
Member Avatar for WaltP
0
213
Member Avatar for rocket100

[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] …

Member Avatar for WaltP
-1
128

The End.