5,676 Posted Topics
Re: Standard C/C++ does not allow you to type and not echo the characters. Input is buffered which means you type and the system stores the characters until the ENTER is pressed. [I]Then[/I] your program reads the characters. Some -- but not all -- compilers have a way around this, but … | |
Re: [QUOTE=bananenflip;321378]It's German Finnish French Dutch Dutch. Or Deutsch Suomi France Nederlands Nederlands. Guess what's my mother language[/QUOTE] Swahili? :mrgreen: | |
Re: [B]Aia[/B], what did you just post? No explanation, no formatting, improper programming practices ([INLINECODE]void main()[/INLINECODE], [INLINECODE]getch()[/INLINECODE], [INLINECODE]clrscr()[/INLINECODE]) You should model good practices and proper techniques. You seem to have been here long enough to know this... ;) | |
Re: [QUOTE=cscgal;320587]The post editing works just fine for me? Does it happen for you all the time? I would suspect that if it was a sitewide problem then some of the moderators would have brought it to my attention already.[/quote] It happened once to me a couple hours ago, but I … | |
Re: [QUOTE=Lerner;321316]I still don't understand what you want to do. [/QUOTE] I agree. You may be skilled in HTML and CSS, but this is a C/C++ board. You post code here, not HTML/CSS markup language. | |
Re: More indentation is needed. Please use 3-4 spaces. 1 is not enough. I'm not going to search through 580 lines of code, so I can only suggest you look at the output and make sure you have a RETURN at the end of each line. That's what it looks like. … | |
Re: > Whatever code-coloring method you're using, please stop it. Instead use [code tags](http://www.daniweb.com/techtalkforums/announcement8-3.html) which are immensly better, and have coloring built-in if you use (code=language) And [Format your code!!!!!](http://www.gidnetwork.com/b-38.html) Slamming everything to the left edge makes the code impossible to read! | |
Re: Use [INLINECODE]getline()[/INLINECODE] to read the entire line and break it into it's pieces. | |
Re: [QUOTE=ithelp;321129]Very few company work on robotics, so your scope would be limited and who said the work is very challenging , you have to maintain millions of lines of software code only and which is ofcourse boring do not expect you will be asked to design at the first day.[/QUOTE] … | |
Re: It's a convoluted way of clearing the input buffer of characters left after the previous read. When you read a number using[INLINECODE]cin[/INLINECODE], the characters after the number are left in the buffer for the nect [INLINECODE]cin[/INLINECODE] to read. That basically means the ENTER is still there, and when you attempt … | |
Re: plzzzzzzzzzzz read the forum rules, especially [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies#faq_keep_it_organized]thread titles & homework requests[/url] (you want [I]us[/I] to finish it for you?) [url=http://www.daniweb.com/techtalkforums/announcement8-3.html]Code Tags[/url] and [url=http://www.gidnetwork.com/b-38.html]Formatting C / C++ code[/url] (you want us to [I]read[/I] your code?) | |
Re: Do you want us to give you an algorithm or help you fix one you've already got? If [I]give[/I], [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies#faq_keep_it_organized]read this[/url]. If [I]fix[/I], we're not psychic. Whatcha got? | |
Re: [QUOTE=JaksLax;319479]I must be looking at this completely wrong because to me it looks like you pass the sum and cBit into the function, but I though that is what the function is suppose to produce. [/quote] [I]sum[/I] and [I]cbit[/I] are values returned back to the calling function. Your function will … | |
Re: [QUOTE=kansmish82;319883]hey, how bout if u try to make it outtextxy(13,13,"a") instead......this function, as far as i know doesn't work without quotes.......[/QUOTE] [QUOTE=Colin Mac;319404]I think it might be. outtextxy(13,13,"a")[/QUOTE] All you need to do is read his request: [QUOTE=abhijit11;319332]Now am trying to display something the user enters onto the graphics screen. … | |
Re: [QUOTE=bigben09;319440]ok my program works the only thing i cant figure out how to do is, print the sum, [/quote] Maybe you can use [INLINECODE]cout <<"The sum of the numbers is : " << sum << endl;[/INLINECODE] ;) [QUOTE=bigben09;319440]... average [/quote] Average is [I]sum / #-of-values[/I] [QUOTE=bigben09;319443]ok i got the numbers … | |
Re: #1: You don't need to double space everything. It's too hard to read. #2: You need to indent consistently, and 3-4 spaces, not 1 or 2 #3: "[I]it is bringing some bit of a problem[/I]" has no meaning. [I]What[/I] is the problem. Describe it, don't make us guess. | |
Re: [QUOTE=waynewilson1;319259][QUOTE=Ancient Dragon;316340]>>if anybody knows how to check text for a specific string and then change it or create a message box(ie. swear detecter) If you are looking for a way to detect obscene language, you might ask Dani because she implemented something similar for DaniWeb a couple months ago. I … | |
Re: [QUOTE=boujibabe;318565]Heres the code I know the indention is terrible but hopefully u would understand:[/QUOTE] Then why not take 30 seconds and make it neat so we don't have to struggle to understand the code. Don't post terribly formatted code you know is bad -- fix it! :rolleyes: | |
Re: First of all, you'll have to figure out how to read a character at a time (without the need for ENTER) which is not standard. I think GCC can do it but you'll have to figure it out yourself. Then you'll have to grab the name of each file in … | |
Re: [QUOTE=joeprogrammer;316927]If you're going to use char arrays, you might as well be using C. And no, I know it's not your fault, so I blame your teacher for that.[/QUOTE] Seems to me the concept here is to learn to process c-strings, because they are necessary in C++. [B]earlyriser[/B], stop using … | |
Re: For right now don't worry about it. Verification of input will probably be later in the course. | |
Re: [QUOTE=donaldunca;311007]But I don't know how to read file "data.inp" line by line. I think I should use fgets, but seem that fgets is used for char. [/QUOTE] Yes, use [I]fgets()[/I] to read the line, then you can use [I]sscanf()[/I] to convert the line into numbers. | |
Re: [QUOTE=davew23901;317027]Never done this before, but here goes... I write VB6 applications and have had little problem installing them on computers at office sites scattered across the country. Now the IT people are putting the clamps down on "non approved" apps and will not give anyone admin rights to the pcs. … | |
Re: [QUOTE=dovb;308030]Did you get your simple password system working? I have a similar task: I want certain passwords to open form A and certain passwords to open form B.\ Can you help?[/QUOTE] Start a new thread (since this one is [B]darkmessenger[/B]'s) and explain in detail what you need. | |
Re: [QUOTE=boujibabe;314663]I been trying to work on my indentation and I thought I was getting better [/QUOTE] [url=http://www.gidnetwork.com/b-38.html]Here's a tutorial[/url] about code formatting. Concentrate on [I]whitespace[/I] as well as indentation. A differnt IDE won't do it all for you, and knowing [I]how[/I] to format is extremely important. | |
Re: [QUOTE=tech291083;316765] If you are an addicted ebayer then: [URL]http://www.youtube.com/watch?v=jCIp7eo4MvY[/URL][/QUOTE] The Original: [url]http://www.youtube.com/watch?v=lQTFdrZFI2g&mode=related&search=[/url] | |
Re: [code=c] switch (xactCode) { case 'D': case 'd': bal += xactAmt ; depAmt += xactAmt ; totDep++ ; case 'I': case 'i': bal += xactAmt ; intPaid += xactAmt ; case 'W': case 'w': bal -= xactAmt ; wdAmt += xactAmt ; totWd++ ; if ((bal < MIN_BAL) && (svcChgd … | |
Re: If you don't want to be bogged down with M$, go with C or C++. They are more general and not 'controlled' by M$ | |
Re: How about: Read a string as ~sos~ suggests. Convert the string to int If it a valid value, use it, else output error | |
Re: [QUOTE=Scling;316523][QUOTE=turquoise;75611]i am just taking this class for one semester but i need help..am i doing this right at all? or should i redo it in another way thank you suroot. ~Fara [I]Posted on Dec 14th [B]2004[/B][/I][/QUOTE] I created a seperate subprogram for each player for most aspects of the game. … | |
Re: Easiest is to pass in the position of the last move then check each direction from that location for 3 in a row. | |
Re: But it's yogurt! If I want spoiled milk I'd just leave it in the fridge for a while. | |
Re: To get over your clown phobia, watch "[I]Killer Clowns from Outer Space[/I]" as soon as possible! | |
Re: [QUOTE=Ancient Dragon;314513]Because in such a trivial program it doesn't make a hill of beams which way its coded. Creating another process is also trivial in most of today's computers; the os would barely even know the process is present in the system.[/QUOTE] All this is true, but aren't we forgetting … | |
Re: > Hey again, I was hoping someone here could look at my code and tell me why I'm not receiving the correct output. > > Here's what I'm supposed to do:Write a program that asks a user to enter an integer, say n,then list all the numbers that are less … | |
Re: So what's the problem? You should describe what's wrong so we know what were looking for. | |
Re: I think this is a great idea, but 3 pages of new posts, most of which I'm not interested in perusing at the moment makes it somewhat unwieldly. If they can be sorted by FORUM-INDEX + FORUM + TIME it might be easier to use since I for one go … | |
Re: And what's our incentive to read 320 lines which inlcudes "[I]Extra shit load added for crappy fun[/I]"? Maybe you should post the section you are having trouble with... | |
Re: [QUOTE=elcrapo;315275]I am having troubles getting this program to generate random numbers. Right now i have it set up to only generate 1 and 19. I do not know how to generate random numbers. thank you if anyone can help my dumbass.[/quote] change [INLINECODE]a = lowest+int(range*rand()/(RAND_MAX + 1.0));[/INLINECODE] to [INLINECODE]a = … | |
Re: [QUOTE=cusado;314537]the program runs, but no output file is generated? am i missing a command still? [code=c] #include <stdio.h> #include <string.h> #include <ctype.h> int main(int argc, char *argv[]) { char line[255]; fgets(line, 255, stdin); char filename[80]; // This line can't be here. It has to // be above all executable code … | |
Re: It doesn't appear so. I there there was a FORECOLOR property but there isn't -- at least not for buttons. Weird. Leave it to M$ to forget a useful property. I did find [url=http://vbnet.mvps.org/index.html?code/intrinsic/buttoncolorcheck.htm]this solution[/url] doing a Google search for [b]vb "command button" color[/b]. Maybe you'll find other options. | |
Re: As mentioned, use [INLINECODE]getline()[/INLINECODE] to read the input. Test the first character and if it's '\n', only a RETURN was entered. Otherwise process the line 'cuz something useful (hopefully) was entered. | |
Re: Also, this piece of code has a BIG problem: [code=c] for (int i = 0; i < 10 && z(); i++) { char* temp = new char;//[500]; cin.getline(temp, 500); [/code] How large is the area pointed to by [I]temp[/I]? I'm surprised it didn't crash on you yet. [QUOTE=raydogg57;314355]I was also … | |
Re: This might work... Set the form to [url=http://msdn2.microsoft.com/en-us/library/czke9azk(VS.80).aspx]transparent background[/url] and maximize the window. | |
Re: Do you know what [I]arrays[/I] are? Do you know the [I]if[/I] statement? Do you know the [I]for[/I] statement? Post your code after reading [url=http://www.daniweb.com/techtalkforums/announcement8-3.html]this[/url] and we can help. | |
Re: Also, look at [B]Joe[/B]'s suggestion about the array. It will make your code extremely simple. | |
Re: Basically, you have to turn the description into a set of quations. This has nothing to do with C++, yet. [QUOTE=tatumkay;313662] 2. A government research lab has concluded that an artificial sweetener commonly used in diet soda will cause death in laboratory mice. A friend of yours is desperate to … | |
Re: [QUOTE=The Dude;311418][url]www.something.com[/url][/QUOTE] $35 a year down the drain.... |
The End.