5,676 Posted Topics

Member Avatar for bensewards

[QUOTE=bensewards;] I have a question about: infile >> names[i] >> grade [i]; Will this go through the first line of the file and put the name in names[] and the gpa in grade[], then repeat with i++?[/quote] What happened when you tried it? That's easier and faster than posting on …

Member Avatar for ravenous
0
1K
Member Avatar for neuro

No, do not use [iCODE]getch()[/iCODE]. That is a non-standard C function (not even C++) in only a couple compilers. Use [B]gerard[/B]'s solution.

Member Avatar for neuro
0
179
Member Avatar for Foxfreezer

[QUOTE=Foxfreezer;1454326]thanks for the thorough response ravenous and red goose. I have a quick question regarding your reply ravenous, when you said: /* Check through things in argv here */ what exactly do you mean? I'm confused as to how I check things through. Thanks![/QUOTE] argv[] is an array. Check argv[1], …

Member Avatar for WaltP
0
193
Member Avatar for rmbrown09

Would you mind defining what "doesn't work" means? Don't know whether that means it doesn't compile, displays the wrong numbers, causes a citywide blackout. Details. Exactly what does it do, and what were you expecting?

Member Avatar for mrnutty
0
621
Member Avatar for Duki

When you find an ad that does this type of thing, do you remove the ad as a violation until fixed?

Member Avatar for Dani
0
216
Member Avatar for apanimesh061
Member Avatar for sudipan007

Use CODE Tags -- they are described all over this site. Including on the background of the box in which you typed your question. Please read the following information: [url=http://www.gidnetwork.com/b-38.html]formatting[/url] [url=http://www.gidnetwork.com/b-66.html]void main()[/url] [url=http://www.gidnetwork.com/b-43.html]pausing a program[/url]

Member Avatar for WaltP
0
98
Member Avatar for diffuse

CODE Tags on the first post!!!! How did you happen to figure that out? Great!!!! :icon_mrgreen: Please [url=http://www.gidnetwork.com/b-38.html]FORMAT[/url] your code properly. Change your IDE to replace TABs with 4 SPACEs. It is very difficult to read your code the way it's posted. Don't you enter a single letter when asked? …

Member Avatar for WaltP
0
268
Member Avatar for BLUEC0RE

You'd be better off reading the entire line and looking through the array rather than trying to mess around with complex file reading techniques. If you can read the entire file, so much the better.

Member Avatar for WaltP
0
178
Member Avatar for Violet_82

[QUOTE=Violet_82;]Hi there,[/quote] Hi. [QUOTE=Violet_82;]I have done a small exercise (ex 4.17 on C++ how to program - deitel and deitel) which basically is about writing a program that uses a while statement to determine and print the largest number of 10 numbers input by the user. The program should use …

Member Avatar for Violet_82
0
192
Member Avatar for lochnessmonster

If the number must be [I]exactly[/I] 5 digits, you'd be better off reading the number as a string and passing it into your function. By reading an int, you have the possibility of an error on the read if they type in a non-digit character. Reading a string removes that …

Member Avatar for WaltP
0
383
Member Avatar for gingank
Member Avatar for rdx71
Member Avatar for frank731tr

When is [iCODE]department == ""[/iCODE]? Are you [I]sure[/I]? If tests don't work, you need to verify the variable values. Output them, or use the debugger.

Member Avatar for frank731tr
0
118
Member Avatar for shivakumar10340

Is this a joke? Not only do you 1) resurrect and hijack an old thread 2) not use CODE Tags 3) post over 2000 lines of bad code 4) use a compiler and functions that haven't been used in 20 years you also expect us to read it, understand what …

Member Avatar for WaltP
-1
178
Member Avatar for fka

So what's the value of [iCODE]w->name[/iCODE] after you read it? When asking a question, give us ALL the details necessary to understand the problem. For example, how do you know that statement is the problem?

Member Avatar for WaltP
0
155
Member Avatar for HENRYSUGAR
Member Avatar for HENRYSUGAR
0
164
Member Avatar for Ieako

If you can't give us any more information than just posting almost 200 lines of uncommented code with no indication what's wrong, where it's wrong, and not using CODE tags, then there's no real help we can give.

Member Avatar for al john
0
165
Member Avatar for Zvjezdan23
Member Avatar for WaltP
0
136
Member Avatar for TomaCukor

Since you seem to be getting answers that don't come close to a solution, maybe you need to describe again more clearly and in detail what you are trying to accomplish.

Member Avatar for WaltP
0
133
Member Avatar for privs

An INI file is just a file that you define. It's a text file containing the data you want to write to it. It's not a [I]special file[/I], it just has a different extension -- .INI

Member Avatar for jonsca
0
210
Member Avatar for anirudhruia
Member Avatar for moroccanplaya

[CODE]while (select < 'A' || select > 'E')[/CODE] Single quotes denote the character

Member Avatar for TomaCukor
0
94
Member Avatar for Violet_82

[QUOTE=Violet_82;] I noticed you guys on this forum don't use [CODE]using namespace std;[/CODE] but I thought it was more a matter of style other than anything else...[/QUOTE] You will notice if you actually look at this forum that we DO use [iCODE]using namespace std;[/iCODE]. Many of us don't necessarily subscribe …

Member Avatar for Violet_82
0
173
Member Avatar for sketchiii

Dev C [I]is[/I] a C++ compiler. But, like most compilers, it can compile strict C programs as well. And yes, given the right knowledge, you will be able to write the program you want.

Member Avatar for MosaicFuneral
0
392
Member Avatar for bbman

Yes, [B]firstPerson[/B] is correct. [iCODE]srand()[/iCODE] should be called only once, at the beginning of [iCODE]main()[/iCODE].

Member Avatar for Narue
0
167
Member Avatar for PCSAWICK829

[B]Stop trying to fix his code![/B] It's correct. The problem is your terminology. You said [QUOTE=PCSAWICK829;]From that point, I go to the command line and after making sure I'm in the correct directory, i type "gcc dumb.c -o dumb" (no quotations obviously) and that's how i run the program.[/QUOTE] That …

Member Avatar for anirudh33
0
255
Member Avatar for shiny27

[QUOTE=gerard4143;]A quick inspection of the code reveals that your not resetting the variable judgeCounter back to zero. A note on code indentation...Please use it. [/QUOTE] Yes, but don't use [B]gerard[/B]'s formatting. Indent 4 spaces, not a full TAB. TABs make the code hard to read. Your IDE can be set …

Member Avatar for WaltP
0
103
Member Avatar for iamthesgt

[iCODE]toupper()[/iCODE] is working fine. You just didn't store the result anywhere, throwing away the modified character. As for [iCODE]line.size[/iCODE], what was input, what is the result, what were you expecting? Remember to give the details necessary for full understanding. Otherwise you get guesses and inadequate help.

Member Avatar for mrnutty
0
218
Member Avatar for murtazamzk
Member Avatar for saleh-elyani

[QUOTE=saleh-elyani;1444412]Hi everybody I wrote this code in my university assignment . But I want to change the global variable (the variables that above the main) to local variable (inside the main) and add the parameters in the functions.[/QUOTE] Ummm, OK. So do it...

Member Avatar for saleh-elyani
0
160
Member Avatar for MrJNV

[QUOTE=firstPerson;]You can use [icode]cin.get()[/icode] to read each individual characters from the stream.[/QUOTE] [QUOTE=jonsca;]... read it in as a string and access the digits as characters...[/QUOTE] How do these suggestions support [QUOTE=MrJNV;]If a user inputs a [B]int[/B] number, say 150...[/QUOTE]:icon_question: :icon_rolleyes: As [B]jonsca[/B] alluded to, look up the modulus (%) operator. …

Member Avatar for mrnutty
0
167
Member Avatar for eesti44

[QUOTE=Lerner;481629]First thing is try a little harder to get the indentation consistent. Code is much easier to debug when it's consistently formatted. [/QUOTE] And to help you with this, [url=http://www.gidnetwork.com/b-38.html]here's some help[/url]

Member Avatar for Freude
0
470
Member Avatar for Rickay

[B]I don't have any problems there. Then why the hell are you hijackingRickay's thread for an unrelated question? Start your own thread! But the real problem I'm having is how can I tell once I can stop multiplying the number by ten? See, your problem is unrelated. Leave this thread …

Member Avatar for Rickay
0
635
Member Avatar for iwanttolearnc
Member Avatar for WaltP
0
119
Member Avatar for imolorhe

NULL is 0. There is no distinction between a variable with no value vs. 0. As [B]jonsca[/B] said define a value as your "no value" number.

Member Avatar for mrnutty
0
532
Member Avatar for shanki himanshu
Member Avatar for Krstevski

How about giving an example of exactly what you want. Telling us it works 121314 doesn't tell us what is correct. Examples help.

Member Avatar for WaltP
0
183
Member Avatar for thelostboy

Another example: You want to know what lights are on in your computerized home. Bits: 0- Front Porch 1- Entryway 2- Living Room 3- Dining Room 4- Kitchen 5- Bathroom 6- Master Bedroom 7- Kids Bedroom In the [I]lights byte[/I] you have [CODE]Byte value 00110101 Bit numbers 76543210 [/CODE] Which …

Member Avatar for thelostboy
0
146
Member Avatar for vinujohnpanicke

Don't call [iCODE]main()[/iCODE] from your functions. [iCODE]return[/iCODE] instead.

Member Avatar for emilo35
0
129
Member Avatar for divyasphoorthy
Member Avatar for WaltP
-2
84
Member Avatar for udaykrishnag

Next time EDIT or DELETE the other post. Don't just leave it for us to clean up.

Member Avatar for WaltP
0
37
Member Avatar for moroccanplaya

[CODE] puts("please enter a file name to create:\n"); scanf("%s", &file_name); // Never use scanf() to read a string. It's dangerous. Use fgets() if( create_pointer = fopen(file_name. "r"); printf("file already exist"); else { if(create_pointer != fopen(file_name"r"); // Didn't the previous fopen already check for this? create_pointer = fopen( file_name, "ab"); } …

Member Avatar for WaltP
0
268
Member Avatar for bufospro
Member Avatar for bufospro
0
156
Member Avatar for enakta13

Then convert all values into individual digits in an integer array. Then you can ignore the fact that floating point values are not exact.

Member Avatar for WaltP
0
238
Member Avatar for hahanottelling

Why not just make an icon for the program and put the in the STARTUP folder of the program list? This way you won't destroy your registry file if you get the code wrong.

Member Avatar for WaltP
0
3K
Member Avatar for exekiel101

I can't even follow your code with the formatting you have. Please [url=http://www.gidnetwork.com/b-38.html]re-format[/url] and post again.

Member Avatar for Clinton Portis
0
185
Member Avatar for cosmos22

You didn't type the filename in properly. And after 3 years, are you even sure [B]prushik[/B] is even around?

Member Avatar for WaltP
0
330
Member Avatar for marooh
Member Avatar for dip7

1) Format your code properly -- [url=http://www.gidnetwork.com/b-38.html]How to do it[/url]. Concentrate in INDENTING. 2) We aren't Psychic! "[I]there is still errors[/I]" is no help at all. Are we supposed to [B]guess[/B] what the errors are?

Member Avatar for Ancient Dragon
0
3K

The End.