5,676 Posted Topics
Re: [QUOTE=sahil_itprof;558012]I m talking about all the programs i have made and I use Turbo C compiler... I am appending the whole code...... Check it out...[/QUOTE] No way. You didn't use CODE tags which are mentioned 1) In [B]The Rules[/B] you read when you signed up 2) In the post aptly … | |
What happened to the ICODE button in C/C++? Could you please add it back, and on the quick reply, too? It would be nice to have a keystroke for it, also. Pretty pleaseeee??? ([I]batting my eyelashes coyly[/I]) | |
Re: [QUOTE=wollacott;559616] i need to know how to clear screen and also how to get the numeric keys without pressing enter. [/QUOTE] Both of those questions are answered in your post. You might want to reread it and look up the things suggested. And while you're at it. [url=http://www.gidnetwork.com/b-38.html]look this up[/url], … | |
Re: Change [icode]cin >> variable[/icode] to [icode]cin.getline(variable)[/icode] And use full words in English as [B]the Rules[/B] specify. You [I]did[/I] read them, didn't you? | |
Re: Try formatting your program so it can be followed. | |
Re: [QUOTE=~s.o.s~;279484]Never used IE, always use FF. Personally what I feel is that IE sucks...(atleast IE6).[/QUOTE] How can you say this? You've never used it so what is your opinion worth? :twisted: I haven't upgraded to IE7 yet (downloading now), but FF is my browser of choice, with IE available for … | |
Re: [QUOTE=dan9992;557869]Ive sorted that problem but how can i read the persons name and write it to a txt file and then read the company name and write it? Also i need to output a " to a text file how do i do this?[/QUOTE] Maybe by having the company name … | |
Re: You need to un-nest your [icode]if[/icode] statements. You need to rethink your code some. What you need to do is take each individual process (input, calculation, output, etc) as individual steps. What you [I]have[/I] is each step integrated (merged) into the previous step. Separate them into input, calculation, output, and … | |
Re: In this case, no. A [ICODE]switch [/ICODE]statement relies on different [ICODE]case [/ICODE]statement values and your [ICODE]if [/ICODE]statements do not have different values. One problem I see in your [ICODE]if [/ICODE]structure is what if 5 of the values in fact match [I]set[/I]. This will only find 1 and stop. This may … | |
Re: [CODE=c] char *string1[100000], *string2[100000]; // You just created // an arrayof 100000 POINTERs not a // string of 100000 characters int a, b, c, count1[27], count2[27], m, no; int main () { for (m=0; m<=26; m++){ count1[m]=0; // Now you set all the POINTERs to 0 count2[m]=0; } gets(*string1); // … | |
Re: [QUOTE=sanjayk1241@yah;558730]Hi, I am using Borland C Compiler for preprocessing a source file. I am using the following command for preprocessing.... C:\cpp32.exe -P- -o"outputfilename" "Sourcefilename" According to my requirement i should get source file comments into preprocessed file. The above command is not satisfying my requirement. I don't which options i … | |
Re: [QUOTE=newport;558121]I'm not sure how to combine the use of bubble sorting and c I/O functions. After opening the file, I don't know how to read the contents.[/QUOTE] Do you have a book? If so, there's a chapter on I/O (input and output). Might want to read that. if you don't … | |
Re: [QUOTE=spec80;557804]My problem is that i do not know how to update the memory locations[/quote] It sounds like your instructor wants you to use [I][B]global variables[/B][/I] for [I]rootone[/i] and [i]roottwo[/I]. Check with him to see if that's true. [QUOTE=spec80;557804]to write into an output file without overwriting what is already there from … | |
Re: [QUOTE=VernonDozier;558658]Not bad, I didn't realize that function existed. I thought you had to write your own![/QUOTE] If the purpose of the program is to teach you how to calculate an average, you [I]do[/I] need to write your own. | |
Re: [QUOTE=Majestics;557051]It will Help you ![/QUOTE] Why this is bad help: 1) No CODE tags 2) No formatting, code is very difficult to read. [url=http://www.gidnetwork.com/b-38.html]See this[/url] 3) [ICODE]#include<conio.h>[/icode] -- not portable. Do not use. 4) [ICODE]void main()[/ICODE] -- [url=http://www.gidnetwork.com/b-66.html]see this[/url] 5) [ICODE]clrscr();[/ICODE] -- only 1 compiler defines this function - do … | |
Re: Try what you [I]are[/I] sure of, and attempt what you can't. Then post what you tried and we can help you fix it if you have problems. | |
Re: Or you can use an equation to get what you want. in your example you specify 3,5,7,9 so: [code] n = rand() % 4; // get numbers 0,1,2,3 n *= 2; // make them now 0,2,4,6 n += 3; // offset them to 3,5,7,9 [/code] | |
Re: [QUOTE=vmanes;558535]A little more information, please. What are you trying to output? Do you have particular formatting requirements (spaces, decimal precision, etc.)? Please show the code you have so far, and tell us what you are having trouble with, in a more specific manner. Then we will be able to give … | |
Re: The best place to put the calculation is after you've read the data used in the calculation. The best place to output the answers is after you've done the calculations. And you need to use CODE tags as described in [B]The Rules[/B] you read when you signed up. Did you … | |
Re: [QUOTE=Code.n00b;557228]i cant seem to figure out are how to accept a user input to start and stop the gas pumping loop and how to pause the loop at the start so that it appears to "zero out" before pumping gas. [/QUOTE] Aren't you supposed to enter the amount of gas … | |
Re: In other words, look at the chapter on [I]Input and Output[/I] | |
Re: [QUOTE=ngozinyeusi;557824]im a biginner level in Visual C++ version 6.0 "how can i Write the Program ”Minesweeper”. [/QUOTE] You don't. That is not a program for a beginner. Start with something easy like craps or tic-tac-toe. | |
Re: [QUOTE=Ancient Dragon;557589]Although correct, I have never seen such an operating system, but there could be one or more very obscure os's that have that quality.[/QUOTE] Which is why you can ignore this advice. I've never seen (at least in the past 25 years) a system that a student uses that … | |
| |
Re: [QUOTE=cscgal;545864]Ad campaigns cannot simply be removed. Each campaign is often the result of weeks of negotiations resulting in signed contracts.[/QUOTE] Since that is so, maybe a requirement that the add is non-intrusive be added to each contract so you can better control the [I]working[/I] of your site. And while you're … | |
Re: Yes, a [I]while[/I] loop would work, or better yet a [I]do-while[/I]. | |
Re: Don't try to do it all at once. First, check for the negative sign. Make sure there is only one and it's first. Then check for one decimal. Last, check that there are only digits, decimal and negative signs in the input. | |
Re: [QUOTE=Joatmon;554792]system pause seems to be frowned upon anyway, but the best replacement (if you don't care about portability) could just be to use #include <conio.h> // windows only, for getch cout << "Press any key to continue."' getch(); //waits until one key is pressed[/QUOTE] A terrible suggestion. Why suggest a … | |
Re: Please explain this line: [icode]scanf("%lf%*c", &y);[/icode] It makes no sense with the format specifier you have. | |
Re: I've loved the Dick Van Dyke Show since it started. And I think he's great is most things I've seen him in! But until you mentioned it, I never made this connection! :icon_eek: | |
Re: I would also suggest better formatting. [url=http://www.gidnetwork.com/b-38.html]See this[/url] and pay particular attention to the [B]Indentation[/B] section. As it is your code is very difficult to follow. | |
| |
Re: It's because you can't create a buffer using a variable as the size: [Code=c] int buffer = 11; char name[buffer]; [/code] You need something like: [Code=c] #include <string.h> #include <stdio.h> #include "input.c" #define BUFFERSIZE 11 FILE *playerdata; int main(void) { char name[BUFFERSIZE]; printf("Please Enter Your Name\n"); printf("Maximum Length 10 characters\n"); … | |
Re: First of all, use CODE tags as explained in the [I]Community Rules[/I] you read when you joined. [code=c] #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <errno.h> void main(int argc, char *argv[]) // argc=#of parameters // argv=array of strings for each parameter { int status; char *prog = argv[0]; // first … | |
Re: We need to see code in order to figure out what's happening. Isolate the problem by creating a small version of the program that exhibits the same problem. Copy your program and start removing sections of code you know does not cause the problem -- piece by piece. When you … | |
Re: As [B]hockeyplayer[/B] suggests, read a line at a time. Then use [ICODE].find()[/ICODE] to locate the @ if present. If you find it, set up 2 loops: Loop 1 tests each character before the @ to find the first character that is illegal in an email address (such as the ']') … | |
Re: When are you going to learn to explain what you want in understandable terms? "[I]I want to call (3,1) then (3,13), then (3,34)..........[/I]" means what? What does "call" mean? "[I]How to declare 3 is the first than 13 is second?[/I]" is also meaningless. The first what? The second what? Give … | |
Re: Please [url=http://www.gidnetwork.com/b-38.html]format your code[/url]. We need to be able to follow it in order to be able to help. And reading [url=http://www.daniweb.com/techtalkforums/thread78223.html]this[/url] will help you give us the info we need. | |
Re: When you read the [B]Community Rules[/B], what part of [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies#faq_keep_it_organized]this rule[/url] did you not understand? | |
Re: [QUOTE=Samadhi69;550523]The main thing I'm not sure of is how to step through the list like I would with java.[/quote] Stepping through the list is done by calling [ICODE]getFirst()[/ICODE] which, I assume, returns the first node in the list. Then passing that node into [ICODE]getRest()[/ICODE] returns the next node. Keep calling … | |
Re: [B]abhikkumarbasu[/B], it would really help if you'd read the threads you are responding in. He very definitely said he's using [I]DevC++[/I]. And I've seen other posts that you've offered the exact same advice as the post immediately before you -- and hours earlier. We appreciate you desire to help and … | |
Re: And [url=http://www.gidnetwork.com/b-38.html]format your code[/url]. It's too hard to follow with inconsistent spacing. | |
Re: You're looking for [icode]kbhit()[/icode], the fraterna; twin brother to [icode]getch()[/icode] | |
Re: You forgot [url=http://www.natural-innovations.com/computing/asciiebcdic.html]EBCDIC[/url] :icon_wink: | |
Re: [QUOTE=carnage;550192]//edit: sorry for the double post.[/QUOTE] If you don't want want to double post, you can [I]edit[/I] your first post. But double posting is not a problem if you have additional information. It's [I]bumping[/I] we frown on. | |
Re: There is so much wrong here!!! Both of you, please [url=http://www.gidnetwork.com/b-56.html]read this about gets()[/url]. This loop (reformatted for readability):[code=cpp] # for (n = 0; n < 11; n++) { if (strncmp(one[n],"xxxx xxxx",10) != 0 && strncmp(two[n],"x,xx xxx.",10) != 0) { cout<<"Mismatch"; } } [/code] has the following problems: 1) the … | |
Re: Use the [ICODE]toupper()[/ICODE] function from [I]ctype.h[/I]: [code=cpp]else if (toupper(userPlay) == 'P' && toupper(cPlay) == 'R')[/code] Also, you should only call [ICODE]srand()[/ICODE] once, so move it to the beginning of [ICODE]main()[/ICODE] | |
Re: Could it be there are no input statements in your code? | |
Re: Also, please read [url=http://www.gidnetwork.com/b-59.html]this series[/url] on [ICODE]scanf()[/ICODE], especially the character and string entries. | |
Re: Or with only one button: [code=vb] Dim StartTime As Date ' Private Sub cmdStart_Click() if StartTime = 0 then StartTime = Now cmdStart.caption = "Stop Timer" else MsgBox DateDiff("s", StartTime, EndTime) StartTime = 0 cmdStart.caption = "Start Timer" end if End Sub [/code] If course you can store the difference … |
The End.