5,676 Posted Topics
Re: [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. … | |
Re: 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 … | |
Re: 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 … | |
Re: 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? | |
Re: 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. | |
Re: [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. | |
Re: Maybe you should reread what Gerard said. He's onto something. | |
Re: [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 … | |
Re: [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 … | |
Re: [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... | |
Re: 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... | |
Re: [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. | |
![]() | Re: 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 … ![]() |
Re: 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 … | |
Re: Look at the [iCODE]getlin()[/iCODE] method. | |
Re: 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. | |
Re: 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 … | |
Re: [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 -- … | |
Re: [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]. | |
Re: 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. | |
Re: [iCODE]srand()[/iCODE] should be called once and only once at the beginning of your program. Move it into [iCODE]main()[/iCODE] | |
Re: [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 … | |
| |
Re: 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... | |
Re: Read the input as a string and check that each character entered fits the base you want. | |
Re: [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 … | |
Re: Also, how do you know when you've reached the end of a list? | |
Re: I like this part: [INLINECODE]tolower(i[q]);[/INLINECODE] I've always wanted "to lower an IQ..." :mrgreen: | |
Re: 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... | |
Re: Considering [B]Nathan[/B] showed you how, I suppose no one deemed it necessary to respond... | |
Re: Define "[I]goes nuts[/I]". That is hard to imagine. Explaining a problem correctly often results in more accurate answers and better help. | |
Re: If you do that, Word won't be able to read the document. | |
Re: Read your input as a string. Then test the characters for valid digits. If good, convert to integer. If not... | |
Re: [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. | |
Re: [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 … | |
Re: 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. | |
Re: [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 … | |
Re: 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? | |
Re: 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. | |
Re: You cannot [I]input[/I] into the string "\t". | |
Re: [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. | |
Re: Read [url=http://www.gidnetwork.com/b-59.html]this series[/url] on [I]scanf()[/I]. It should answer your questions. | |
Re: Use CODE Tags properly, please. Look up the definition of fscanf() . Does it return EOF? | |
Re: One way is after you read the line, read each word of the line within a loop using [iCODE]sscanf()[/iCODE]. | |
| |
Re: Look into loops. FOR and WHILE loops will help you get started. You [I]did[/I] read the member rules, right? | |
Re: 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 … | |
Re: 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 … | |
Re: Think about it. What's your format specifier? What is being replaced in the format specifier? What is it being replaced with? | |
Re: No, it's because of [url=http://c-faq.com/expr/evalorder2.html]this[/url] |
The End.