5,676 Posted Topics
Re: If you enter the number 12, how many keys do you actually hit? 1, 2, 3? If you actually read the number (12) what's left in the input buffer to be read at the next input? | |
Re: I'd do something similar to [B]Clinton[/B]'s idea read a line with getline do the find like he does if found do the fprintf there is no need for vectors based on your post and i'm sure they are beyond your knowledge people here think vectors are the best thing since … | |
Re: You forgot the ; on line 6. The IF in line 8 cannot be in all capital letters. And you misspelled PRINTF | |
Re: Yes, it's completely possible. Set up an index array [ICODE]idx[/ICODE]. Then [ICODE]month[idx[2]][/ICODE] and [ICODE]dblval[idx[2]][/ICODE] will be a matched pair. During the sort, check [ICODE]arrayEntry[idx[i]][/ICODE] with [ICODE]arrayEntry[idx[i+1]][/ICODE] and if they need to be switched, switch only [ICODE]idx[i][/ICODE] and [ICODE]idx[i+1][/ICODE]. The actual arrays stay in their original order, only the index array … | |
Re: Contact your local library or unemployment office. They have books that outline salary ranges for most if not all professions. | |
Re: [QUOTE=sahilk50;]plz tell me how can i add purchase in choice menu ...[/QUOTE] Do you seriously not know how to add PURCHASE to the menu? [QUOTE=sahilk50;]...and it gets added to the program ...[/QUOTE] Follow the pattern set forth for the other items. [QUOTE=sahilk50;]...and it works as a software ...[/QUOTE] No idea … | |
Re: Sorry, but most of us won't download files. Everyone here posts their code (using CODE tags) and asks specific questions to get help. See the Member Rules. | |
Re: I'm just waiting to hear the Democridiots. They're a hoot! As for charging the rich 5% more -- why? Make the tax laws sensible. Line 1: What did you make? Line 2: Deductions - few and sensible, not hundreds of pages worth. Line 3: What's left? Line 4: Multiply by … | |
Re: Put the menu in a function. Call the function anytime you need it. | |
Re: [b][boilerplate_help_info][/b][code] Posing 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: That's because you don't do any calculations within the loop. All you do is display the values you calculated before the loop starts. Before posting "[I]how do I fix it[/I]", think... | |
Re: [QUOTE=ben1996123;]I've never had a problem with files before, but now I can't seem to get it to work properly. I have this code: [CODE] fstream someFile("file.txt"); ... [/CODE][/QUOTE] Is the file opened for read, write, append, ??? Did the open return an error? | |
Re: You now have to look at each character and decide if it's a 1) letter 2) digit 3) operator And set values accordingly. For example, you [I]could[/I] do something like: [CODE] string variable[10]; // hold 10 variable names (a, b, c, etc) int varindex; // the index of the variable … | |
Re: [b][boilerplate_help_info][/b][code] Posing 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: Well, there's the [ICODE]switch[/ICODE] statement: [code] #include <stdio.h> int get_index(int value) { switch(value) { case 0: case 1: case 2: case 3: return 0; case 4: return 1; case 5: case 6: case 7: case 8: return 2; case 9: return 3; case 10: return 4; default: return 0; } … | |
Re: Sorry, I'm not going to fight through all that unformatted code. It's difficult to follow. [url=http://www.gidnetwork.com/b-38.html]See this[/url] to learn how to format code for readability and easier coding. | |
Re: The statement "[I]they r just not working[/I]" tells us nothing. You need to tell us what the code [I]is[/I] doing, and what it is [I]supposed[/I] to be doing instead, as the post titled [url=http://www.daniweb.com/techtalkforums/thread78223.html][b]Read Me:[/b] Read This Before Posting[/url] suggests. It's obvious the code you posted does not compile, it's … | |
Re: [QUOTE=aero31aero;]first thing, Initialise the variables that you have declared. If you don't, then they contain garbage values.[/QUOTE] Not necessary if the first thing you do with any variable is read or load a value into it. | |
Re: [QUOTE=rchris2121;]May be but I m not familiar or learned get or put yet. Is there any other way to do it???[/QUOTE] So? Why do you need [ICODE]get[/ICODE] and [ICODE]put[/ICODE]? What needs to change in your code to make it C rather than C++? | |
![]() | Re: What I know about footy I learned from the dog in Footrot Flats! And Ol' Wal, of course... ![]() |
Re: Compilers rarely say "There is an error". They usually tell you much more about the error so there's something useful to think about. | |
Re: [url=http://lmgtfy.com/?q=q=queue+fifo+rule]Try This[/url] | |
Re: [QUOTE=hkdani;]First of all, it would help for readability to use what are universally accepted variable declarations for variables.[/QUOTE] They are far from universal. [QUOTE=hkdani;]Experienced programers used to accepted standards could easily mistake your variables for the wrong type.[/QUOTE] No we don't... Standards of this type are company or personal standards, … | |
Re: [b][boilerplate_help_info][/b][code] Posing 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: Use [iCODE]fgets()[/iCODE]. It clears the buffer and places the data into a [I]char*[/I] of your choice. There's the input buffer you have total control over. | |
Re: [QUOTE=Cross213;]Yes I have an old fashioned phone, and I have tried the *69 thing but doesn't work, that may be because I live in South Africa, any other solutions?[/QUOTE] Hmmm let's see. South Africa. Phone. Ummmmm. Can't think of a thi... No Wait!!!! Call your phone company! Noooo, you'd have … | |
Re: To begin with: [b][boilerplate_help_info][/b][code] Posing 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 … | |
Re: [QUOTE=SI THU;1675424]thank you, but that not.I mean system date in OS.[/QUOTE] If it's not the system date, what is [B]date[/B]? What's wrong with using it? | |
Re: Try it without the bastardized [B]*_s[/B] functions. Just use [iCODE]fscanf()[/iCODE] and [iCODE]fopen()[/iCODE]. They are standard and work in all compilers. Be sure to check the syntax of [iCODE]fopen()[/iCODE] because it's different than your use of [iCODE]fopen_s()[/iCODE] | |
Re: Read all inputs as strings. Then test to see if all characters are digits and if so, convert to a number and continue. Otherwise, process an error. | |
Re: If the site doesn't have any info, contact then directly. | |
Re: [QUOTE=Narue;]Though I [I]will[/I] ask the usual question: if these folks aren't searching the forum before starting new threads, what makes you think they'll read the stickies? ;) [QUOTE=cwarn23;]Because when a new user comes to post a thread, they don't like to look through pages of pages of results to find … | |
Re: [QUOTE=lbgladson;]I was about to start working on the other functions but the assignment says I cannot use cstring! Wouldn't it make it much easier if I could?[/QUOTE] Then you have to rewrite. [ICODE]char*[/ICODE] is [B]cstring[/B] | |
Re: Second post of the exact same question... Thread closed. | |
Re: [b][boilerplate_help_info][/b][code] Posing 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: [b][boilerplate_help_info][/b][code] Posing 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: Mostly FFox. Once in a while Opera. IE only when I have to (maybe 3x a year) | |
Re: Actually, you should have 2 [iCODE]if-else[/iCODE] statements: [iCODE]if even increment evenCount else increment oddCount[/iCODE] Same with positive/negative As for exiting when 0, add one more IF to encompass everything from just after input to bottom of the loop. [iCODE]If != 0, do the stuff[/iCODE] | |
Re: [QUOTE=minghags;]This isn't what I need, I need to count stars that are written by function and count them (a.k.a. Surface Area). Thanks anyway.[/QUOTE] It's [I]exactly[/I] what you need. As [B]Clinton[/B] shows, increment a counter every time you output a *. I leave you to work out the rest of the … | |
| |
Re: Where did you close the first file before opening the second file with the same FILE variable? | |
Re: Nitpick... [QUOTE=MonsieurPointer;]First off, the parentheses are missing (sizeof[B]([/B]arraytotal[B])[/B]).[/QUOTE] Although most programmers use [ICODE]sizeof(x)[/ICODE], it's perfectly acceptable to say [ICODE]sizeof x[/ICODE]. | |
Re: [b][boilerplate_help_info][/b][code] Posing 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: You do it exactly as you did -- assuming your description is exactly what you have. Therefore, give us a [I]complete[/I] description of 1) where the data come from that gets loaded into the array 2) your code that loads the array 3) the entire code that looks at the … | |
Re: Create a function called [iCODE]isdelim(char c)[/iCODE] that tests [B]c[/B] for one of the delimiters. | |
Re: Depends on what you mean by [B]interact[/B]. Nothing kinky I hope. | |
Re: [QUOTE=elmoe26;]I'm having trouble figuring out why my program has stopped after 20 moves. [/quote] Looks like you decrement [B]squaresLeft[/B] even when the square you test has already been used. [QUOTE=elmoe26;] Also I am not sure how to keep all moves on the board itself. [/quote] Test. After adding [B]vertical[][/B] and … | |
Re: Mind giving us useful information? Like [B]what[/B] it does wrong? | |
Re: [QUOTE=MonsieurPointer;]Don't forget to close your file handle! [CODE]{ fclose(file); printf("%s was opened successfully.\n", fileparam); printf("Good\n"); system("pause"); }[/CODE] Also, it is good practice to initialize all pointers to [I]NULL[/I]: [CODE] FILE *file = NULL;[/CODE][/QUOTE] It's also good practice to explain why [url=http://www.gidnetwork.com/b-43.html]system("pause"); is a bad thing[/url]... |
The End.