5,676 Posted Topics
Re: [QUOTE=jephthah;610856]get rid of the [b]long[/b] type cast. that's what's hurting you here. Furthermore, since you've already defined everything as a [b]double[/b] anyhow, you have no need to do any type casting at all. they already are doubles. this is all you need to do to get your answer: [code]beloeb = … | |
Re: Gee. IE -- strike one. Vista -- strike two. Only need one minor thing to go wrong and -- strike three. You're OUT! :icon_wink: | |
Re: ICODE is not meant for multiple lines of code. That's what CODE tags are for. Extra whitespace on a single line of code may or may not be useful. I probably agree that ICODE should retain whitespace, but not EOLs. | |
Re: Or add output statements to display values as the program runs with the location within the program. | |
Re: Interesting.... A few comments -- opinions, to be sure (except the first): [B]Theories[/B] are not facts. The are based on observations and [I]seem[/I] to hold true, but aspects of the theory still have not been proven. That's why they are called [I]theories[/I] instead of [I]facts[/I]. [B]Creationism[/B]: According to Isaac Asimov, … | |
Re: [QUOTE=sagz;605761] I had been thinking along those lines, but probably way off with...[CODE]if ( choice != "y","Y")[/CODE][/QUOTE] Yes, you're off. You have to test each character individually. Something along the lines of [icode]if ((n < 5) || (n == 10))[/icode] which is TRUE if [I]n[/I] is 4 or less [I]OR[/I] … | |
Re: [QUOTE=linux;341658]Sorry if this belongs elsewhere, it's BASIC, so VB is the closest. (By the way, long time no post for me, I'm back, yay) Okay. I'm writing a game (a SRPG) in QBASIC (wicked leet, huh?) so that my friends can edit it and crap (I know other languages, but … | |
Re: [quote=WolfPack]As for syntax changes, I tried the Professional Version for some time, and the major irritation was that the use of functions like strncpy has been [URL="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncode/html/secure03102004.asp"]deprecated [/URL]in favour of microsoft specific functions like strncpy_s. So you may get a lot of compiler warnings saying this and that is deprecated, … | |
Re: [QUOTE=helloan;598425]Is there anyway to do this without using rewind? We haven't learned this yet.[/QUOTE] Just close and open the file again. | |
Re: A stack makes sense. That way you'd be able to catch problems like [icode]This is a <I><B>mismatched tag pair</I></B> too.[/icode] | |
Re: [QUOTE=a2008;590212]Hi, I was hoping someone could shed some light on this for me. I am stuck on an assignment. I have spent 3 weeks on it and have almost finished it. I have so much going through my head at the moment I just need some help. Please. I do … | |
Re: [QUOTE=sickly_man;590080]so i cant actually return a number like in C or C++? in other words, the RETURN statement in my get_fore and get_back subroutines is incorrect/illegal? so i guess i will have to put these values in registers before i do the return statement, right? it seems to me then, … | |
Re: I'm with [B]Aia[/B] on this topic. Although compilers treat \0 and 0 the same, they are not, since one is a character and the other is an integer. It has to do with human perception, not compiler equivalences. It's the same as teaching children to dial [I]nine-eleven[/I] in case of … | |
Re: [QUOTE=superjacent;483639]Thanks for the advice, very much appreciated. I've altered the code as suggested and is a lot 'cleaner' looking. [/quote] Not bad, although it's still not [url=http://www.gidnetwork.com/b-38.html]formatted properly[/url]. By the way, what does [ICODE]cin.clear();[/ICODE] do? You might want to look it up. Another thing to look at is [ICODE]system("PAUSE");[/ICODE] [url=http://www.gidnetwork.com/b-61.html]See … | |
Re: First, get rid of the clear screen stuff since you cannot make it portable and is not part of standard C++ Second, get rid of the GOTO statement and use a while loop instead Third, you say you want the "[I]second out put replaces the first[/I]" so change your output … | |
Re: [QUOTE=rje7;569274]im building a telephone directory. and the code is given below. i am using file system to store the record which i get from the user. and then i should be able to do searching, deleting, sorting and other default telephone dir functions. so far i have been able to … | |
Re: I also like the split bar, but when you click on something on the second bar, the top bar resets to HOME. IMO it needs to remember the setting. In my case, i always want FORUM. Also, the second bar seems longer than before, requiring more horizontal scrolling. Can the … | |
Re: Alt-PrtSc to copy the active window to the clipboard Ctrl-V to paste it into Paint. | |
Re: We're not going to do your homework for you. You need to show us what you did and we can help you fix it. | |
Re: [QUOTE=Narue;368053]But there's no requirement that the size of a long be related to the size of an int provided that both meet the minimum size requirements.[/QUOTE] Which kinda sucks when you want [I]long[/I]s to be longer than [I]int[/I]s :icon_wink: | |
Re: #1) Learn to [url=http://www.gidnetwork.com/b-38.html]format your code[/url] so it's readable #2) Isn't [B]y[/B] a single character? What's the proper [ICODE]printf()[/ICODE] format specifier for a character? That should help. | |
Re: You're talking about [I]command line[/I] parameters. [B]Narue[/B] is correct. You can check out [url=http://www.gidnetwork.com/b-45.html]this information[/url] on how to use the command line. | |
Re: I was at the infamous concert where he got down on one knee to start Hound Dog, and said :I think I just ripped my pants!" He sang 3 songs, then called the Gospel group on stage while he changed. That was the second concert I saw. | |
Re: You cannot compare strings with the == operator. Look up the function [icode]strcmp()[/icode] | |
Re: Use one of these compilers: [url=http://bdn.borland.com/article/21751]Turbo 1.01[/url] [url=http://bdn.borland.com/article/20841]Turbo 2.01[/url] [url=http://148.231.149.200/aplic/tc30.zip]Turbo 3.0[/url] | |
Re: [QUOTE=dougy83;570051]The problem's in your code; without seeing your code it's a bit hard to see where the problem is...[/quote] No it's not. Almost every error is [icode]... error C2664: 'carddeck' : cannot convert parameter 1 from 'int' to 'int []'[/icode] You are passing an [I]integer[/I] in parameter 1 of [B]carddeck[/B] … | |
| |
Re: [QUOTE=Nessie;571974]Entirely your choice, but I would use a while loop. I would also use recursion (i.e. your function should call itself within the loop), as you'll need to print out the columns in reverse order to how they're calculated.[/QUOTE] I wouldn't. I'd just write the loop properly. | |
Re: [QUOTE=vardhani;570003]I want to know a small c code to generate random numbers.It could be within a certain range. I want to know if rand() function will generate a random number[/QUOTE] Yes, [icode]rand()[/icode] will generate a random number. Also, look up the [icode]srand()[/icode] function which you will also need. Then search … | |
Re: [QUOTE=terminator0031;569164][B]THE ULTIMATE SOLUTION IS THIS[/B][/QUOTE] Only if you can't program... :icon_rolleyes: | |
Re: [QUOTE=g_loughnan;569733]So if I write:[/quote] No [icode]estimate(data, n, m, &xms,d);[/icode] [B]data[/B], [B]n[/B], [B]m[/B], [B]d[/B] have no value [icode]for (i=0;i<m;i++)[/icode] [B]m[/B] has no value [icode]printf("\n%f, d[i]");[/icode] Improper syntax. Try [icode]printf("\n%f", d[i]);[/icode] instead. | |
Re: Copy the file where ever you want, as [B]jephthah[/B] suggests. In the code, use the full path to the file. | |
Re: Yes, as [B]Traicey[/B] implied, learn to [url=http://www.gidnetwork.com/b-38.html]format your code[/url]. Most of the errors you would have found without asking. [ICODE]F:\C ++ Numerical Methods\Newton_Raphson.cpp(183) : error C2043: illegal break[/ICODE] -- a [B]break[/B] must be within a loop or switch [ICODE]F:\C ++ Numerical Methods\Newton_Raphson.cpp(184) : warning C4508: 'main' : function should return … | |
Re: [QUOTE=jimJohnson;569119]tried that and still getting some errors..... c:\documents and settings\don & diane kruep\desktop\project 04\p04.cpp(28) : error C2664: 'Get_Name_and_Num_Classes' : cannot convert parameter 1 from 'int' to 'std::string &' 1>[/quote] The function [ICODE]Get_Name_and_Num_Classes[/ICODE] has the first parameter defined as a [I]string[/I], you are passing an [I]int[/I] instead. | |
Re: What are you trying to accomplish with this statement? [icode]if (month=12, month<=3)[/icode] | |
Re: IMAO Flash ads should be banned. They are annoying resource hogs. And Flash sites too. Flash should be used to enhance a site, not [I]be[/I] the site. | |
Re: When you press ENTER all by itself, where does it go? What does it look like? That's what you put in place of [B]???[/B]. | |
Re: You need to make a decision on how to input a move. Once you make that decision, make another function to accept moves. | |
Re: [B]jephthah[/B], "[I]try to keep code basic and readable for the next guy, rather than using clever logical constructions[/I]" is very good advice. But then using [icode]if (!strcmp(progress,"YES") || !strcmp(progress,"NO"))[/icode] is not easily understandable. It assumes you understand that [icode]strcmp()[/icode] returns FALSE on equality, which is illogical. Better to use [icode]if … | |
Re: In order to input the data, you must open the file first. Then you need to read each record and load your structure. Maybe you should read the entire file when you start the program and just keep all the records in memory so you have access to them at … | |
Re: So you get that far and quit? And we get to finish it for you, and we have no idea what's not working? Somehow I don't think I need an A that bad. | |
Re: [QUOTE=cscgal;564976]Creating a unified rating system does make sense, but it would take awhile to code, so is more likely something a month or so down the line. There are a couple of things that I want to accomplish first, such as adding a 'Flag Bad Post' link to the blogs … | |
Re: [QUOTE=Ancient Dragon;565443]If you don't believe me, then what can I say except for you to read your textbook about pointers. One of our members WaltP has a very good signature or something like that.[/QUOTE] It's actually [B]Salem[/B]: [QUOTE]If you dance barefoot on the broken glass of undefined behaviour, you've got … | |
Re: [QUOTE=cscgal;331594]Being the age that I am, and first getting into Star Trek while in college a couple of years ago, the original series is just too corny.[/QUOTE] Maybe by today's standards, but when it first hit the airwaves, man it was the greatest! I like both Kirk and Picard but … | |
Re: [QUOTE=Daphene;564997]Hey did anyone ever reply to you?[/QUOTE] Can't you tell by the posts in this thread? | |
Re: [QUOTE=FireNet;545082]P.S Refer to my reply to your mail.[/QUOTE] [QUOTE=vmanes;545090]As I'd said privately....[/QUOTE] No one should be answering private requests for help. That's because no one should be [I]asking[/I] for private help. Help is what these forums are for. Keep all questions and answers in the forums, please. [QUOTE=vmanes;545193]Not disputing what … | |
Re: [QUOTE=severman;563587]could any 1 tell me why this code isnt working right?? two.txt is not wriiten good... [/QUOTE] Because it's written poorly? It's [I]your[/I] job to tell us 1) what the program is supposed to do 2) what exactly goes wrong 3) why it's wrong 4) what is supposed to happen … | |
Re: What you need, in addition to learning how to use [url=http://www.daniweb.com/techtalkforums/announcement8-3.html]CODE tags[/url], is two loops. Loop 1 is for each game. Inside that loop is loop 2 for each guess. You are using one loop for guessing and winning which is very difficult to handle. The first thing in the … | |
Re: [QUOTE=technogeek_42;556942]owh i get it but hwo about in million can u make me some codes of that like this [/QUOTE] Can't you write ANY code at all? Do we all need to do your homework for you? [QUOTE=Necrolis;557018]This is lazyness, but i have nothing to do atm so.... [/quote] "... … |
The End.