5,676 Posted Topics
Re: [QUOTE=Duoas;479410]Cool [B]Narue[/B]! I didn't know that. (I suppose that's the kind of brain damage I get for having tried it years ago on some silly, ancient, broken DOS C compiler.) [B]Doublex[/B], how about this one: [inlinecode]printf( "%s", strcpy( "Stupider", "Stupid" ) );[/inlinecode] (results may vary).[/QUOTE] Results may crash! | |
Re: [QUOTE=mikeandike22;473291]Hi im trying to take a .dat file with just a list of integers separated by lines. The program has to allow for whether or not the list is an even amount of numbers or not. im a bit stuck well what i want it to do is store the … | |
Re: Good for you. That is a fine program to use to learn fstream, arrays, and some math concepts. Good luck. | |
Re: Set X=x+20 Add 20 to X Increment X by twenty 20 is added to X In other words, any way you want to word it. | |
Re: Use the [icode]remove()[/icode] function. You have to find out where the file is and pass the path to the function. | |
Re: Look up the [ICODE]fmod()[/ICODE] function to replace the % operator. | |
Re: [QUOTE=ssjad05;480493]oh sorry i forgot to mention that it suppose to print out the names and scores in ascending order.[/QUOTE] You did? Here's your first post. Read the first line: [QUOTE=ssjad05;480455]When it prints it does not print the numbers and names in ascending order like its suppose to do and i … | |
Re: [QUOTE=Lerner;480408]1) don't use eof() to control the loop.[/quote] Why not? Don't you think an explanation would be more helpful rather than simply dictating to posters? It might actually teach them something. [B]phvan[/B], [url=http://www.gidnetwork.com/b-58.html]see this[/url] ([ICODE]feof()[/ICODE] is identical to [ICODE].eof()[/ICODE]. [QUOTE=Lerner;480408]2) Read the file line by line using getline(), not >>. … | |
Re: It's been too long and ForTran has changed. If you explain what the arrays mean in FTN, we can probably give you more exact answers. | |
Re: [QUOTE=niek_e;480128]I disagree. If your oven has a conveyor belt build in to it, it would be possible to eat the first part of the pie, while the other part is still in the oven being baked. :)[/QUOTE] I [I]dare[/I] you to try it! :icon_twisted: | |
Re: [QUOTE=johnnyjohn20;480425]wish i was good at this! humph!![/QUOTE] You will be. Hooray!!! Just takes practice... | |
Re: [QUOTE=Duoas;478189]Your compiler lets you get away with it, but in C you should generally stick all variables before any code...[/QUOTE] Not [I]generally[/I]. It's [I]always[/I]. :icon_wink: [QUOTE=Duoas;480348]BTW. What happened to your nice [B][[I][/I]code[I][/I]][/B] blocks? (Only use [B][[I][/I]inlinecode[I][/I]][/B] for a single line of code.)[/QUOTE] There are no nice code blocks. I fixed … | |
Re: [QUOTE=nicz888;479539]3)i entered this input output 2 wrong input a wrong input s wrong input q quit[/QUOTE] Did you try my suggestion? Output various values at key spots in the program to see what values are not as expected. [QUOTE=nicz888;479539]4)when i enter q the i am surprise program ends, but when … | |
Re: [QUOTE=cgraves;479742]let me know what you think[/QUOTE] Terrible. Never call [ICODE]main()[/ICODE]!!!! Use a loop. And CODE tags. They were mentioned in the rules you read when you registered. (You [I]did[/I] read them, didn't you?) Also, you have no repetition, no user defined functions, and no option to quit. You didn't follow … | |
Re: You forgot a ; when you declared answer Please read the post Read Me: Read This Before Posting . It's called that for a reason. | |
![]() | Re: So what [I]have[/I] you figured out? Didn't you read [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies]the Rules[/url] and [url=http://www.daniweb.com/techtalkforums/thread78223.html][b]Read Me:[/b] Read This Before Posting[/url] yet? ![]() |
Re: My only problem with Registry First Aid is the lack of ability to look at only a portion of the errors. Like when you get 400 errors you can't single out a certain type, nor can they be sorted. Other than that, it works well. | |
Re: [QUOTE=iamthwee;478696]When are the old-style smilies gonna become obsolete? I say they should be, otherwise I might question why there was any point of having the new smilies commissioned.[/QUOTE] [QUOTE=jbennet;478699]agreed[/QUOTE] Disagree. [QUOTE=iamthwee;478777]I don't think the original smilies are consistent with the style of the rest of the site. You should get … | |
Re: [QUOTE=ricnyx;479529] what should i do to get the output i wish?[/QUOTE] By reading [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies]the Rules[/url], which has been suggested many times to you already. And you obviously missed [I][url=http://www.daniweb.com/techtalkforums/thread78223.html][b]Read Me:[/b] Read This Before Posting[/url][/I] too. [QUOTE=ricnyx;479529]pls help me ... im newbie .... just study c++ for a few week...[/QUOTE] And … | |
Re: Or, a little easier: [code] int main () { float b; float f = 123.457678F; float b = (int) (f + 0.5); cout << b; return 0; } [/code] | |
![]() | Re: What part of "Use code tags" did you not understand? ([url]http://www.daniweb.com/forums/post479400-2.html[/url]) |
Re: [QUOTE=controlsi;479139]any in sight would be helpful. im really under the gun and have been trying to get this to work for a couple of days. thanks in advance David[/QUOTE] With what? You didn't mention anything was wrong. Did you read the post titled [url=http://www.daniweb.com/techtalkforums/thread78223.html][b]Read Me:[/b] Read This Before Posting[/url]? | |
Re: Look up the bubble sort. It's much easier than the selection sort. [QUOTE=tones1986;478934]Comments such as "you have no idea what you are doing", "you shouldnt code this or that its horrible" are NOT welcome. Im learning - you all learnt at some point too. So let me work at it. … | |
Re: Here are some problems you should fix: [code] #include <cstdlib> #include <ctime> #include <iostream> using namespace std; // prototype and name space declaration bool testAnswer(int, int, int); void correctOutput(); void incorrectOutput(); bool mathTest(); //------------------------------------------------------------------ //------------------------------------------------------------------ //------------------------------------------------------------------ int main() { if (mathTest()) [color=red]// Just call mathTest. This IF is really confusing...[/color] … | |
Re: Each second add 1 to a counter and output that counter. | |
Re: If you get 42, the universe will end! Hopefully, you code uses 2 nested loops -- FOR loops are best. | |
Re: [QUOTE=r5ingh;477577] im confused as to how to write an error checking function and how to write a decode function which decodes morse code. It cannot simply be a backwards of the encode function because ONE morse code is made up of FOUR characters...? (if you get what i mean?) i … | |
Re: [QUOTE=anshul.dilli;477808]hi plz help me overcome [B]a few errors[/B] in my encryption project.... thanks[/QUOTE] Such as? | |
Re: [QUOTE=Jishnu;476478]By the way, you should have posted this in the C forum. There is nothing specific to C++ in this thread.[/QUOTE] There's nothing specific to C either. Other than he's writing a C++ program. | |
Re: This is not a question for a help forum. This is something you should get from a book, instructor, or tutorial. We can help once you understand the concepts. | |
Re: [QUOTE=ricnyx;478033]hehe....u free....can help me solve my problem??[/QUOTE] You waited an entire 9 minutes before bumping your post? C'mon, we don't [I]live[/I] on this board. Read the entire file into an array of strings and loop through them. | |
Re: See the comment I added at the bottom of the code [CODE=C]int main() { length = strlen(string); boolean = IsPalindrome(string, 0, length); ... } int IsPalindrome (char* string, int left, int right) { if (left >= right) { return TRUE; } if (string == string) { return IsPalindrome(string, left+1, right-1); … | |
Re: However you want to make the file you want to read. Notepad is fine for text files. You can also write a program that accepts info from the user and writes it to a file for another program to read. | |
Re: Aren't the posts [QUOTE][B]Read Me: [/B]C++ Books [B]Read Me: [/B]C / C++ FAQ's and Practice problems[/QUOTE] helpful? | |
Re: [QUOTE=rogenie;470189]here is my code. I don't know why it always returns the value that i do not ask for.?? This code display the name I typed in if it is inside the array. [/QUOTE] Probably because you returned the value you didn't want. Because you didn't explain 1) what you … | |
Re: If you get errors, the technique to get help is to post the errors [I]exactly[/I] as you see them (cut & paste, don't retype). Based on he code [I]snippet[/I] you posted, you are only missing the randomizer[ICODE]srand()[/ICODE]. | |
Re: [[I]Hard-handed response[/I]] If they've been told about the rules that many times, infract them! [/[I]Hard-handed response[/I]] :icon_twisted: I know it's not nice, but that's how I'm feeling today.:icon_redface: | |
| |
Re: [QUOTE=johnpmii;476996]Hello, I'm tring to read a text file and pull pieces of the line into separate functions. I can open and close the file in the main. When I use the getline() it reads the whole line, I only want to read up to a certain point using strings instead … | |
Re: [QUOTE=enes;477767]i want to to able to access to a class's vairable but this varible is not declared class's header file it is in the cpp file i couldn't write a method that acces to it because methods cannot access it(since the variable is not in the header file) how can … | |
Re: C'mon, guys. Stop telling him it's impossible! Ben, since you are new, you need a more detailed plan. #1) How do you envision access to the music. Files on disk? Streams off web? #1a) If files, for you know how to navigate a disk? #1b) If streams, do you know … | |
Re: [quote=purplegerbil]This is a bit basic but might help.[/quote] A bit [B]basic[/B]! LOL That's a good one!!!! :D [COLOR=RoyalBlue]See, BASIC is the language, so it struck me funny.... Oh, never mind!![/COLOR] | |
Re: He doesn't. He just want attention by posting lame questions that are mostly unintelligible. He probably has refused to read The Rules and other helpful posts to aid in asking good, well formatted questions.. | |
Re: We love you too, but we're still not going to write your program for you. Read the recommended info here (rules, posts) and formulate a question we can answer. | |
Re: "[I]User-specified[/I]" means you must be able to read "[url=http://www.gidnetwork.com/b-45.html]command line arguments[/url]" and convert the arguments to integers. The program will be run with a command similar to: [icode]progname lowval highval[/icode] Then in the code grab [I]lowval[/I] & [I]highval[/I] (which will be c-strings) and use them. | |
Re: Let's see. "[B]A multilingual coded Hello World! thread[/B]". In BASIC: [code] print "Hello Wereld" ' Dutch print "Hello World" ' English print "Bonjour Monde" ' French print "Hallo Welt" ' German print "Γειάσου κόσμος" ' Greek print "Ciao Mondo" ' Italian print "Hello Mundo" ' Portugese print "Здравствулте! Мир" ' … | |
Re: [QUOTE=Real-tiner;105345]And I need real time programming with millisecond accuracy, which Microsift has taken away.[/QUOTE] M$ hasn't taken it away. It was never in Standard C in the first place so it was compiler dependent. I believe there is an API to handle what you want, which means it would be … | |
Re: [QUOTE=Lardmeister;475175]Good grief, nobody would ever use the same computer for ten years! One exception, maybe the government does for flight control.[/QUOTE] Nobody? You don't know the people I know... | |
Re: [QUOTE=alcoheca;475370]Still having problems, and the culprit is definelty the string.erase modifier. Does this modifier have to be called by reference ( I mean by a pointer to a string) and the other statements like newstr[i] do that by default? Is that the problem? At the moment [B]newstr.erase(j)[/B] // j=8 wipes … |
The End.