5,676 Posted Topics
Re: [iCODE]scanf()[/iCODE] cannot read two words easily. And it's only slightly less dangerous than [iCODE]gets()[/iCODE]. Look up [iCODE]fgets()[/iCODE]. You will have to check the last character for \n and remove it, but it's safer and easily reads the entire line. | |
Re: [QUOTE=queenjay14;]Im having some problems identifying where my error is. I've read through the post on this topic and applied the responses to my code but it's still giving me a warning. I am trying to use an array to compute the average of 10 numbers. [CODE] double sum = sum … | |
Re: The only question you asked is "[I]can someone help?[/I]" Maybe you need to ask different questions... | |
Re: Yeah, so? Try asking a question and describing a difficulty. | |
Re: [QUOTE=Adak;]You're trying to shove a first and a last name, into the same variable, name[]. That won't work. You can fix it easily a few different ways: [snip] [CODE]char name[30]; //30 is a little small for a two name size, try 50 or 60 //fgets() is safer and a more … | |
Re: [iCODE]scanf()[/iCODE] only reads up to the first whitespace (Space, Tab, Return). You want to read the entire line. Use [iCODE]fgets()[/iCODE] In general, you don't want to use [iCODE]scanf()[/iCODE] to read strings anyway. [url=http://www.gidnetwork.com/b-62.html]Here's why[/url]. Plus, think about your loop again. Do you really want the name entered to be your … ![]() | |
Re: Other than it doesn't work properly, do you have a question? Or is this an ego-post? | |
Re: The second thing is you need to give us a hint as to what's wrong. We aren't psychic. That's [url=http://www.flashlightcreative.net/portfolio/1-flash/38-mindreader.html]another website[/url]. | |
Re: You probably have to parse the line in stages. When you get to the times, keep parsing until the format changes. Looks like times format is [iCODE]char char time time[/iCODE], so when the [iCODE]char char[/iCODE] isn't there anymore, switch to the next format. | |
Re: Or to ask a more appropriate question, "[I]Do you have any links to reputable sites that review hosting companies?[/I]" | |
Re: [QUOTE=Duki;]The reason you continuously loop when you enter bad input is because you're trying to accept a number, but are receiving a char, and your input buffer is overflowing.[/quote] It's not because of an input buffer overflow. When you try to read a non-digit into an integer, the read fails. … | |
Re: Why did you remove all the [B]while[/B] keywords in the second post? Back to your 1st post: [QUOTE=Zoe123;]I have some menu problems. So this is my first time, and I need someone to please solve the problem for me. [/quote] We don't solve things [I]for[/I] you. We help you solve … | |
Re: [QUOTE=mariegomez84;]Hi, everyone! I'm kind of in a hurry. I need to know [B]for tomorrow[/B] how can I open a file and get the file name.[/QUOTE] This was posted on March 6th, [B]2008[/B]!!!!! Stop resurrecting this zombie for no reason! Better yet, go ahead and try! Mwahahaaaaa!!! :icon_twisted: | |
| |
![]() | Re: So your professor wants you to have someone write [I]file search software[/I] for you? You don't need to do anything but ask, correct? |
Re: [QUOTE=stru;]Hello.. I searched the forum for a thread that explains how to rename your username, but I couldn't find any.. How can I assign a new name to my membership here? Thank you.[/QUOTE] And you didn't find one thread titled something like "Please change my username?" You certainly didn't look … | |
Re: If you need help you need to explain what you need help with we are not mind readers please explain in detail what you are trying to do what the problem is and where in the code the problem occurs the more detail the better also you need to use … | |
Re: [QUOTE=gman1991;][CODE]// this is program designed to create Cd data base #include <stdio.h> #include <string.h> #include <stdlib.h> //============================================= //LINKED LIST USED FOR CREATING THE DATABASE CD //============================================= struct CD_type_node { int CDnum; char title[20]; int CDcount; struct CD_type_node* next; }; struct Artist_type_node // to create a linked list of CD's { … | |
Re: 1) Start *letter* at 'a' 2) Start the `do-while` loop 3) IF *letter* is not vowel 4) output the letter 5) increment the letter 6) end of `do-while` if *letter* >= 'z' | |
Re: What are some of the methods that strings have that you can use? | |
Re: [QUOTE=Prankmore;]I am trying to take a user input phone number and perform calculations on it as an integer of type long long.[/QUOTE] Why? To see if the phone number is prime? This makes no sense because a phone number isn't a number, per se. | |
Re: OK What gives? 1st post - a sh*tload of errors with no context 2nd post - code with no commentary, no questions, two days later 3rd post - worthless bump for no apparent reason 4th post - another worthless bump for no apparent reason This thread is about to be … | |
Re: When programming, you need to write the program (it's writing a [I]program[/I], not writing a [I]code[/I]) in stages. Finish what you have and output the data entered at the end. Compile. Fix compiler errors. Repeat. When the program runs correctly (that means outputs the data entered correctly) then add the … | |
Re: Start at [B]Narue[/B]'s first post. The answer is there. You just have to look it up. | |
Re: Sounds like an ego problem to me :icon_mrgreen: | |
Re: First off, [url=http://www.gidnetwork.com/b-57.html]see this[/url]. Next, [url=http://www.gidnetwork.com/b-60.html]see this, too[/url]. It contains the information that describes your problem. And [url=http://www.gidnetwork.com/b-56.html]this info[/url] is the most important of all. | |
Re: I'd stop using a site that a lot of people have errors on. | |
Re: [QUOTE=jheanal;]what is the code in timer if the user enter a negative number a dialog box will appear saying that is invalid !![/QUOTE] You wouldn't put a dialog box in a timer. [QUOTE=jheanal;]NEED THE ANSWER ASAP THANK YOU[/QUOTE] We don't feel your emergency is our emergency. We will answer when … | |
Re: [QUOTE=Salem;]> yes that is a correct way u can proceed......... Over a year late, and still you missed the better answer from ~s.o.s~[/QUOTE] Let's add another 3 years to that. | |
Re: [QUOTE=MooGeek;]I've seen some posts of users changing their usernames. But some of them are like below 50 posts. [/quote] So? What's the problem? [QUOTE=MooGeek;]I mean why would they want to change their Usernames if they've just have less than 50 posts? [/quote] Because they decided they don't like their member … | |
Re: Count the wins and losses. The one with the higher win count wins. | |
Re: [QUOTE=iamthwee;333757]you need kbhit()[/QUOTE] [QUOTE=iamthwee;333776]That's nice, do you think system("cls") is standard and cross platform compatible?[/QUOTE] This was hilarious!!! Suggesting a non-standard function then pointing out something that's not standard! :) Decide which side of the standard you sit on and stay there, don't vacillate. Also, [INLINECODE]system()[/INLINECODE] [I]is[/I] a standard library … | |
Re: [QUOTE=arlir;]what is the matter with this code?[/quote] For one, it's a bad title for a thread. For two, no CODE Tags. For three, bad formatting. Four, old code practices from the 1980's. First things first. 1) Read the Member Rules. Make an effective title for your thread. 2) Code Tags … | |
Re: Yes, [B]zdep[/B] had posted badly formatted code to solve [B]aomas98[/B]'s problem. What grade do you think [B]zdep[/B] should get for his effort? What about [B]aomas98[/B]? Who should pass the class? | |
Re: Why not just set up a standard sort and use [iCODE]strcmp()[/iCODE]? [CODE] for i = 0 to MAX-1 for j = MAX-1 to i+1 by -1 strcmp(array[j-1], array[j])) swap if needed [/CODE] | |
Re: What does [iCODE]strtok()[/iCODE] return? Given the answer to the that question, what does [iCODE]entry[i].interface = strtok (NULL, "\t");[/iCODE] do? Same for each call to [iCODE]strtok()[/iCODE]. | |
Re: [QUOTE=tedman102;](sorry for the lack of braces, I tried getting rid of some for less confusion. Didn't think it would work but thought I might as well try :D)[/QUOTE] 1) Don't apologize, fix it. Add braces and you won't be sorry. 2) Removing braces makes the code confusing. 3) So put … | |
Re: Then write more code. Find an easy project that is just hard enough to teach you that one more thing. Then do it again and again and again. And as a student, by definition you are still a beginner. After two years, you are still a beginner. After maybe 3 … | |
Re: I get no errors when I compile --- at least after removing StdAfx.h header. What compiler? What O/S? | |
Re: [QUOTE=jess64k;]Sorry for the confusing title. [/quote] At least you tried... :icon_mrgreen: Thing #1: [CODE] if (catchvar == '-') //if there is a '-', pop off the '<' and the letter its erasing { array.pop(discardvar); array.pop(discardvar); } [/CODE] What if the sentence is supposed to be "[I]Now- the time is now![/I]" … | |
Re: People thinking before posting questions in software forums. Using CODE Tags. What a dream! | |
Re: Start by [url=http://www.gidnetwork.com/b-38.html]formatting your code[/url] properly. You are probably getting lost, as I am, trying to decipher your code. What us the [iCODE]flushall()[/iCODE] supposed to be doing? See [url=http://www.gidnetwork.com/b-66.html]this[/url] also. | |
Re: If I understand you correctly, [url=http://www.daniweb.com/software-development/cpp/threads/374956]this thread[/url] offered no help at all and you decided to post another thread with the exact same question? This one's closed, continue with the original. Plus, I gave you an (almost) perfect algorithm to do this task. | |
Re: And yet another poster that doesn't think telling us what's going wrong is worth knowing. | |
Re: With a C++ IDE. [COLOR="Red"]Spaces [B]after[/B] all sentences. You are writing English! Do it properly! [/COLOR] | |
Re: To return a value from the function and assign it to the integer [B]a[/B] (as in your code): 1) Make the function an [B]int[/B] instead of [B]void[/B] 2) Set an integer variable [B]val[/B] to some value in the function 3) [B]return val;[/B] at the end of the function 4) Set … |
The End.