5,676 Posted Topics

Member Avatar for stud02

[QUOTE=stud02;1361708]hi, Is it possible to load a c file into another c file? I want to give a list of functions used in the c file. [/QUOTE] Sure. Open the C file with your new program and read the file a line at a time, looking for the function names. …

Member Avatar for WaltP
0
117
Member Avatar for BarnacleBoy

I've said it before -- I'll say it again... Jeez!!! The problem you are having is with the digital limitations of floating point values. They are not exact. When you keep adding 0.01 to a value, a small error will creep in because floating point cannot represent all numbers with …

Member Avatar for vijayan121
0
216
Member Avatar for garu525

First of all, you read two numbers and never read any more. Try this: Read the first number. Set min and max to this number. This seeds the min/max with at least one number actually in the list. Set up a loop to read the rest of the numbers one …

Member Avatar for garu525
0
312
Member Avatar for aznlitomik3

Where do you output the first day of the month? Do you know what day of the week this first day is? What can you do to move that 1st day under the correct day label before you output the first day?

Member Avatar for Lerner
0
155
Member Avatar for Bozog

Hey guys, the OP said [QUOTE=Bozog;506450]i can't find what i have to do so that my c program increments my counter by 1 [B]it has to find and empty line[/B].[/QUOTE] The definition of a paragraph is not ambiguous. He defined it.

Member Avatar for Martin B
0
1K
Member Avatar for DrueY

[QUOTE=DrueY;]What do the numbers tell me, in terms of frequency, amplitude and maybe time? Thank you muchly! drue[/QUOTE] Pretty much everything. If you are really asking "What is the format of a file", you'll have to search the web for for a definition of the file format.

Member Avatar for DrueY
0
482
Member Avatar for cortez716
Member Avatar for myk45

[QUOTE=myk45;1361464] Can i further improve it in any way? Thanks.[/QUOTE] Yes. See the comments I added: [CODE] void trimString() { char s1[] = "hello world"; char s2[] = "el"; int i, j; /* Do not use strlen() as a loop parameter. Use it to load a variable before the loop …

Member Avatar for myk45
0
179
Member Avatar for gregarion

[CODE] random_integer = rand()%10; for(int i = 0;i< index ; i++) { if(num[i] == random_integer){ // Why are replacing a good number with a new number? random_integer = rand()%10; // How do you know the new number isn't the same as the old number? num[i] = random_integer ; // and …

Member Avatar for ixmike88
0
116
Member Avatar for Jennifer84

[QUOTE=LevyDee;1361580]Hah, I did not =(. But I think my solution would have worked well though![/QUOTE] I beg to differ.... Look [I]carefully[/I] at the question...

Member Avatar for WaltP
0
4K
Member Avatar for Pooch74

Where did you call [iCODE]strReverse()[/iCODE]? Where did you call [iCODE] palindromeCheck()[/iCODE]? Where does [I]equal[/I] get set to T or F? You have to actually [I]try[/I] calling them, they don't just run automagically...

Member Avatar for WaltP
0
136
Member Avatar for Lenny19

[B]gurdeep kaur[/B], how does your post help [B]Lenny19[/B] with his problem? Or do you have a [I]new[/I] question which needs to be asked in it's own thread? Before starting [I]your[/I] thread, read some of the posts that explain how to post your question properly, which includes The Rules.

Member Avatar for saeed67
0
1K
Member Avatar for chudapati09

1) Assuming you need to "[I]access each number one at a time[/I]", put the program in a loop. Inside the loop, read a number, use it, then when the loop returns to the beginning, the next number will be read. 2) If you need to use multiple numbers at the …

Member Avatar for chudapati09
0
156
Member Avatar for lover99509

There is no function to do what you want. All you have is a string of characters. When you convert into a number, you'll know. Short of counting the characters and analyzing whether the characters are greater than "32767" or "65535", just convert into a long and don't worry about …

Member Avatar for cool beans
0
3K
Member Avatar for alex55
Member Avatar for airy joy

Please stop using cutsey text. Beginning letters of sentences are in upper case, the rest in lower case, as per English Writing Style. Yes we have the code. Can you [I]have[/I] it? No. We do not give code for the purposes of cheating. It's [I]your[/I] class, not ours.

Member Avatar for Software guy
0
117
Member Avatar for Castiel1631

Well, the 61 characters you are reading into [I]first[/I], [I]last[/I], and [I]middle[/I] are being loaded into the 30 character array [I]student_file[/I] (do you see a problem there?) Then next read loads the next name into the 30 character array [I]student_file[/I] (what happened to the previous name loaded?) Also, are you …

Member Avatar for IsharaComix
0
140
Member Avatar for Meleeruler

[I]cin.ignore[/I] has absolutely nothing to do with [I]cout[/I]. Nothing. It has to do with [I]cin[/I]. When you input a number using [I]cin[/I], you hit a RETURN to allow the number to be read. But the RETURN is left in the input buffer to be read on the next input -- …

Member Avatar for Meleeruler
0
259
Member Avatar for kuchick32

[QUOTE=kuchick32;]I have a problem. I got my file to open but I don't know how to modify the file and have the output I need. [/QUOTE] Well, the first thing you have to add is reading the file [i]input.txt[/i].

Member Avatar for kuchick32
0
107
Member Avatar for Mikeysaxton

Since you didn't bother formatting your code, it's hard to follow. My guess is you're outputting your \n at the wrong time.

Member Avatar for Mikeysaxton
0
203
Member Avatar for totalwar235

[iCODE]srand()[/iCODE] should be called once and only once at the beginning of your program. Move it into [iCODE]main()[/iCODE]

Member Avatar for totalwar235
0
146
Member Avatar for bigwhiteegg

[QUOTE=bigwhiteegg;]This is the main part of a project I assume all other header and cpp file are correct cuz most of them are copy from books n the professor[/QUOTE] Bad assumption. Check them to make sure they are correct. And [B]n[/B] is not a word. Be sure to reread the …

Member Avatar for bigwhiteegg
0
107
Member Avatar for beatenbob
Member Avatar for aviavyne

Set up a while loop and exit if number < 10. If not <10, add the digits. You have to try writing something to get more detailed help...

Member Avatar for WaltP
0
139
Member Avatar for moonlight06

Read the input as a string and check that each character entered fits the base you want.

Member Avatar for moonlight06
0
563
Member Avatar for manoj201jain

[QUOTE=~s.o.s~;283879][QUOTE=jwenting;283874]and why are you using a 20 year old compiler?[/QUOTE]Pssst..dont let Mr. WaltP hear about that....:cheesy:[/QUOTE]:mrgreen: I'll bet it's because the instructor is a relic of the 80's and refuses to update his knowledge so his students can program in today's market. Especially since 15 years ago Borland removed graphics …

Member Avatar for Ancient Dragon
1
1K
Member Avatar for hoganmadman
Member Avatar for darkAngel

I like this part: [INLINECODE]tolower(i[q]);[/INLINECODE] I've always wanted "to lower an IQ..." :mrgreen:

Member Avatar for bbman
0
902
Member Avatar for rizrash

Yes, you can write either program without strings. Very easily. [QUOTE=rizrash;344303]Specially whatever i make i should able to grasp it comletely in order to explain to the prgrammer !![/QUOTE] As you should with [I]all[/I] programs you write...

Member Avatar for Adak
0
2K
Member Avatar for XodoX

Considering [B]Nathan[/B] showed you how, I suppose no one deemed it necessary to respond...

Member Avatar for XodoX
0
168
Member Avatar for hoganmadman

Define "[I]goes nuts[/I]". That is hard to imagine. Explaining a problem correctly often results in more accurate answers and better help.

Member Avatar for hoganmadman
1
145
Member Avatar for Jack_1
Member Avatar for Nandomo

Read your input as a string. Then test the characters for valid digits. If good, convert to integer. If not...

Member Avatar for Nandomo
0
2K
Member Avatar for BlakTasTic

[QUOTE=BlakTasTic;1350151]and I assume that involves malloc or calloc, where is a good site to relearn those key concepts again?[/QUOTE] No, it involves creating space: [iCODE]char answer[20];[/iCODE] Also, [url=http://www.gidnetwork.com/b-62.html]see this series[/url] on scanf(). You are using it dangerously.

Member Avatar for WaltP
0
103
Member Avatar for zaacze

[QUOTE=Lerner;339235]I see Ancient Dragon has typed faster than I and with a more precise version of what to do. As a learning experience here's a sampling of ideas I have about your code: 1) use int main(), not void main()[/quote] Yes, [url=http://www.gidnetwork.com/b-66.html]see this[/url] [QUOTE=Lerner;339235]3) when using statements requiring braces format …

Member Avatar for Ancient Dragon
0
176
Member Avatar for burcin erek

Use an array for the 4 cards. Get a random number from 0-3. This will be an index into that array to point to the win card.

Member Avatar for burcin erek
0
107
Member Avatar for NewVBguy

[quote=NewVBguy;269940]Hi There, I am trying to open a txt file with no header using vb6. my problem is that it's converting the first record as header. how can I solve this problem so that my first record will stay. Below is my code: Private Sub ccommand1_Click() Dim cnn As New …

Member Avatar for peter_budo
0
138
Member Avatar for moteutsch

Not to rain on your picnic table, but of what real use is yet another site that has recipes that are already posted on a dozen other sites already?

Member Avatar for moteutsch
0
148
Member Avatar for usagi

When you read "[B]::::::::[/B]" you know the next line is a name, followed by another "[B]::::::::[/B]". Then read the data up to the blank line or "[B]::::::::[/B]" saving each line in an array. Then look through the array for your keyword. Continue by reading the next name information.

Member Avatar for usagi
0
203
Member Avatar for exekiel101
Member Avatar for smize33

[QUOTE=ArkM;810549]It's your antiquarian ...[/QUOTE] [url=http://www.merriam-webster.com/dictionary/antiquarian]antiquarian[/url] -- The compiler is not a person. Antiquated is the proper term.

Member Avatar for N1GHTS
-2
189
Member Avatar for jemz

Read [url=http://www.gidnetwork.com/b-59.html]this series[/url] on [I]scanf()[/I]. It should answer your questions.

Member Avatar for jemz
0
118
Member Avatar for DarkChewby

Use CODE Tags properly, please. Look up the definition of fscanf() . Does it return EOF?

Member Avatar for N1GHTS
0
97
Member Avatar for wildberries

One way is after you read the line, read each word of the line within a loop using [iCODE]sscanf()[/iCODE].

Member Avatar for WaltP
0
139
Member Avatar for D33wakar
Member Avatar for ambegin

Look into loops. FOR and WHILE loops will help you get started. You [I]did[/I] read the member rules, right?

Member Avatar for WaltP
0
37
Member Avatar for mmiikkee12

One array and two indecies. One index points to the empty position for the next character to be added. Other index points at the character to be removed when needed. When either getst to the end of the array, reset to beginning. You need to decide when the queue (this …

Member Avatar for kiranxxx
0
2K
Member Avatar for harshchandra

Actually, it's very bad code, as [B]manutd[/B] points out. 1) Illegal form of [ICODE]main()[/ICODE] used 2) Made with a compiler at least 25 years old 3) Using functions that don't exist in today's compilers 4) Using headers that don't exist in most compilers 5) No comments make the code completely …

Member Avatar for ezkonekgal
-2
2K
Member Avatar for sakthi@daniweb

Think about it. What's your format specifier? What is being replaced in the format specifier? What is it being replaced with?

Member Avatar for planetmirchi
0
171
Member Avatar for sakthi@daniweb
Member Avatar for WaltP
0
72

The End.