5,676 Posted Topics

Member Avatar for mameemonster

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?

Member Avatar for D33wakar
0
142
Member Avatar for dakerao

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 …

Member Avatar for WaltP
0
193
Member Avatar for fkrafi
Member Avatar for james6754

You forgot the ; on line 6. The IF in line 8 cannot be in all capital letters. And you misspelled PRINTF

Member Avatar for WaltP
0
338
Member Avatar for scarlettmoon

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 …

Member Avatar for phfilly
0
529
Member Avatar for pyro 214

Contact your local library or unemployment office. They have books that outline salary ranges for most if not all professions.

Member Avatar for Ancient Dragon
0
1K
Member Avatar for sahilk50

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

Member Avatar for WaltP
0
363
Member Avatar for spicyrelish

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.

Member Avatar for WaltP
0
133
Member Avatar for pseudorandom21

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 …

Member Avatar for GrimJack
0
234
Member Avatar for pendo826
Member Avatar for AmerJamil

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

Member Avatar for mazzica1
0
155
Member Avatar for PSP1202

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...

Member Avatar for WaltP
0
113
Member Avatar for ben1996123

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

Member Avatar for WaltP
0
136
Member Avatar for aFg3

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 …

Member Avatar for Narue
0
192
Member Avatar for neveragn

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

Member Avatar for neveragn
0
139
Member Avatar for ZedChu

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; } …

Member Avatar for WaltP
0
148
Member Avatar for cummings15

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.

Member Avatar for raptr_dflo
0
151
Member Avatar for conan19870619

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 …

Member Avatar for XDenasdc
0
687
Member Avatar for minhviet93

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

Member Avatar for WaltP
0
222
Member Avatar for rchris2121

[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++?

Member Avatar for WaltP
0
165
Member Avatar for diafol

What I know about footy I learned from the dog in Footrot Flats! And Ol' Wal, of course...

Member Avatar for diafol
0
332
Member Avatar for Nawaf15

Compilers rarely say "There is an error". They usually tell you much more about the error so there's something useful to think about.

Member Avatar for raptr_dflo
0
411
Member Avatar for sunn shine
Member Avatar for bonzo2008

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

Member Avatar for hkdani
0
178
Member Avatar for keylord1013

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

Member Avatar for hkdani
0
212
Member Avatar for vedro-compota

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.

Member Avatar for hkdani
0
6K
Member Avatar for Cross213

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

Member Avatar for Cross213
0
130
Member Avatar for minimi

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 …

Member Avatar for D33wakar
0
154
Member Avatar for SI THU

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

Member Avatar for hkdani
0
123
Member Avatar for yurigagarin

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]

Member Avatar for yurigagarin
0
1K
Member Avatar for babyhuyx

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.

Member Avatar for WaltP
0
172
Member Avatar for Zssffssz
Member Avatar for mzimmers
0
124
Member Avatar for cwarn23

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

Member Avatar for WaltP
0
174
Member Avatar for lbgladson

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

Member Avatar for WaltP
0
137
Member Avatar for daniel1977
Member Avatar for WaltP
0
82
Member Avatar for daniel1977

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

Member Avatar for WaltP
0
97
Member Avatar for champu8

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

Member Avatar for WaltP
0
92
Member Avatar for adkool

Mostly FFox. Once in a while Opera. IE only when I have to (maybe 3x a year)

Member Avatar for crunchie
2
897
Member Avatar for PSP1202

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]

Member Avatar for MandrewP
0
436
Member Avatar for minghags

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

Member Avatar for WaltP
0
114
Member Avatar for Mopikope
Member Avatar for Mopikope
0
120
Member Avatar for Se7Olutionyg

Where did you close the first file before opening the second file with the same FILE variable?

Member Avatar for Narue
0
173
Member Avatar for Se7Olutionyg

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

Member Avatar for Narue
0
405
Member Avatar for Anas Shahid

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

Member Avatar for WaltP
0
235
Member Avatar for sohar11

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 …

Member Avatar for WaltP
0
100
Member Avatar for rugged1529
Member Avatar for WaltP
0
127
Member Avatar for Zssffssz
Member Avatar for vijayan121
0
175
Member Avatar for elmoe26

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

Member Avatar for elmoe26
0
3K
Member Avatar for infantheartlyje
Member Avatar for infantheartlyje
0
184
Member Avatar for Se7Olutionyg

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

Member Avatar for D33wakar
0
190

The End.