5,676 Posted Topics
Re: Since you like to be repetitive: Do you know how to copy from one array to another? You should, [URL="http://www.daniweb.com/forums/thread332892.html"]after your other thread[/URL]. All you need to do is take that solution and modify/expand it to fit this situation. | |
Re: Calling [iCODE]time()[/iCODE] returns an integer. Look it up. | |
Re: You resurrected a thread that's been dead for 18 months to give this completely lame answer? How is the date returned as a string to [iCODE]main()[/iCODE] as the O/P requested? | |
Re: To satisfy these requirements [QUOTE=Adami;]2. If user is trying to enter more than a N*N numbers, system will throw him out with an appropriate message. 3. If user provide less than a N*N numbers, system will throw him out with an appropriate message.[/quote] you need to loop simply waiting for … | |
Re: [QUOTE=MysticMan3000;]My question is how can i ask the user to enter a certain hour of his choice e.g. 11:05:03[/quote] [code] cout << "Enter a time in the format hh:mm:ss -- " << endl; cin >> GetTime; [/code] | |
Re: 1) By always outputting and inputting the exact same format in each file. [I]chargold[/I] is always, say, the third value read. 2) By outputting the name as you output the value: [iCODE]fdat << "chargold=" << chargold << endl;[/iCODE] Then as you read the file, when you read "[I]chargold=[/I]", the data … | |
Re: Sorry, I can't see your screen from here. It might be nice to let us know [I]what[/I] errors -- or should we guess? | |
Re: That sounds even more convoluted. You could clear out the bits you don't want: [iCODE]i = i & 0xFFFFFF;[/iCODE] to make the value 24 bits. | |
Re: Please explain in detail. I, for one, am confused by your request. | |
Re: It is proper English, it's just not used often. It will rarely if ever be spoken. When written it feels like formal English rather than a more colloquial form. [QUOTE]You need Adobe Flash Player 8 (or above) to view the charts. It is a free and lightweight installation from Adobe.com. … | |
Re: This is not something Standard C++ is not able to do. You have to call some functions from the operating system, or some very non-standard functions that few compilers have implemented. | |
Re: Just add up "[I]5 Total duration of call in minutes[/I]" as they are calculated. | |
Re: Please learn to [url=http://www.gidnetwork.com/b-38.html]format your code[/url] properly. It's very difficult to follow. | |
Re: If you need help, you need to explain [I]what[/I] you need help with. All you've said is "Here's what I need to do, Here's my code." No mention of what the trouble is. | |
Re: You're still blowing past your array. You need to stop 'playing' with the index. If you make a 10-element array, loop from 0 to 9, not 1 to 10. And don't add/subtract from the index. | |
Re: Since you posted this as a POLL, not a request for help, my poll response is: You may fail your course because you cannot follow instructions. Following instructions is a [I]requirement[/I] in programming. See the Member Rules as requested when you joined. | |
Re: Yes, we can help you. Yes, it is a silly request since you didn't bother to give us any indication what you need help with. We don't code for people, we help you fix [I]your[/I] code. Be sure to read the Member Rules. | |
Re: You close it. It's your thread.... Just mark it solved. | |
Re: How would you do it on paper (IOW, how did you generate the above patterns?) Think carefully about your decisions when and how to use spaces and stars. Look at the patterns and using [B]jonsca[/B]'s hint you can translate your pattern into code. | |
Re: It's too complicated. If all you are doing is adding two large numbers: 1) read the numbers as you did, have one more array for the answer. 2) convert each character digit to a numerical digit (hint: '3' - '0' = 3) 3) start at the end of each number … | |
Re: Oh, ghod! Another one of those ridiculous suggestions to a student use a [I]vector[/I] instead of an array. A [I]vector[/I] is a higher level object and if you can't use an array properly, vectors are not the solution. The solution is to [I]learn to use an array![/I] Learn vectors when … | |
Re: Open the data file as #1 Change the LPRINT statements to PRINT#1, When done CLOSE #1 | |
Re: [QUOTE=Ancient Dragon;]Oh that's a great way to teach people how to program. I suppose if you every get a job you will expect eveyone else you work with to do your work for you so that you can sit on your ass and play with yourself.[/QUOTE] And he had to … | |
Re: "For Writing" - If the file does not exist, create it. If it does exist, open and empty it. "For Update" - Open an existing file, you can read from it, you an also write to it. | |
Re: Try changing your output from [iCODE]cout << w1 << " " << setw(8); [/iCODE] to [iCODE]cout << setw(8) << w1 << " "; [/iCODE] | |
Re: [QUOTE=seanbp;]#include <stdio.h> #include <unistd.h> #include <termios.h> #include <iostream> [/QUOTE] This won't work at all using most compilers. I dare you to try it on VC++. Using O/S and compiler dependent solutions are problematic. These include * [ICODE]system("pause");[/ICODE] * Any Linux/Unix-only solutions: [ICODE]unistd.h[/ICODE] and [ICODE]termios.h[/ICODE] * Non-standard C function [ICODE]getch()[/ICODE], defined … | |
Re: Why do you first time posters [I]always[/I] leave out the most important information to understanding the problem? The response to the information given: [QUOTE=mohd22;]I wrote the code but its gives me error [/QUOTE] That's because you did something wrong. Don't you think what the error is might be an important … | |
Re: Do you really need help counting the characters in the string? Look at the methods associated with a string object. | |
Re: To all those here asking for us to give them free code -- That's not how these forums work. You do the coding. You post what you have that doesn't work. We help you [I]fix[/I] that code. Do [B]not[/B] post code that simply has a comment that says "[I]// this … | |
Re: Also 1) Improper C syntax [CODE] int loadToFile(FILE *f,int *file_pointer,int *length){ *length++; // executable statement double size=6000000; // definition statements int i; char *substr[6000000-50+1]; unsigned int no_of_strings; [/CODE] You must define your variables [I]before[/I] executing any code 2) You may be trying to create too much data. 78M on each … | |
Re: [QUOTE=cscgal;]Yes, cookies are required to contribute to DaniWeb.[/QUOTE] I'll ship you a box tomorrow. Oreo or Chips Ahoy? | |
Re: [QUOTE=aviavyne;]Can anyone come up with a loop to read the the data from the file and read it into the dat?[/QUOTE] Yes we can. But it's [I]your[/I] task, not ours. You come up with the loop and if it doesn't work, we can help you fix it. But we aren't … | |
Re: [QUOTE=Sniper rooney;]please can anyone make a program in c language to convert a number from decimal to hexadecimal system using switch statements and please don't use arrays or %x[/QUOTE] Yes, many of us can. But since we aren't a free coding service, we won't. But we can HELP you do … | |
Re: By writing a program that creates that output. Did you bother to read the Member Rules as requested? | |
Re: Simply add one. A [I]char[/I] is simply a number output in a special way. B is the value 66, C is 67. | |
Re: [QUOTE=Vindal;]I keep getting location errors c4700 errors and a bunch of initializing errors Here is the full code again I really do not know how to fix this. [/QUOTE] Neither do we, since we don't know [I]what[/I] initialization errors there are, nor where. And c4700 doesn't mean anything to us … | |
Re: Like we said in your other post, you need to decide if you want to write a C program or a C++ program. [CODE] #include <iostream> // C++ #include <conio.h> // non-standard- don't use #include <stdio.h> // C #include <string.h> // C int delete= 0; char parname[20]; char valname[20]; FILE … | |
Re: [QUOTE=GuitarComet;]When you want your program to be portable[/QUOTE] Excuse me? Don't you mean [I][B]not[/B][/I] portable? You wouldn't use them. IMO, they are unnecessary. | |
Re: [QUOTE=garevn;]I use c++ if u could provide some help i would appreciate thank you :)[/QUOTE] Then why are you posting in the C forum? :icon_rolleyes: We can't help you with C++ in the C forum. | |
Re: You are passing a single character. [iCODE]atoi()[/iCODE] requires a character array (pointer) | |
Re: [QUOTE=dflor;]I didn't understand [B]why[/B] for(...) at the beginning, a[i] has to be 0.[/QUOTE] Who says it [B]has to be[/B] 0? Test it. First thing in the program just print out the array. | |
Re: You are doing too much at one time. Take the program a setp at a time so you can understand completely what you are doing. First, read the file and output what is read. No more. Then [QUOTE=mocha8688;]1. count number of words in file[/quote] Get that running completely (and properly) … | |
Re: [QUOTE=cscgal;]Here's an example of what the page looks for blud, our sysadmin: [url]http://www.daniweb.com/certificates/stats.php?u=6790[/url] He has a respectable 546 posts under his belt and has solved 18 threads to rank #420 for solving threads. But it might be encouragement for him to see that he only needs to solve two more … | |
Re: What you're asking doesn't make sense. [QUOTE=frankchester;]I'm aware you can use putchar() but that doesn't really work so well for what I'm doing, [/quote] Why? Are you trying to output a character and it's outputting a flower? Maybe you need to be more explicit so we can understand what you're … | |
Re: [code] const int DAYS = 7; const int TEMPS = 2; for (int days = 0; days < 7; days ++) { cout << "Enter High Temp for day " << days + 1 << ": "; cin >> xTemps[DAYS][TEMPS]; // This always loads xTemps[7][2] -- // which does not … | |
Re: Two floating or double values are rarely equal. You have to test for a range -- maybe within 0.001 tolerance. [CODE]if ABS(val1 - val2) > 0.001) // check if close to equal[/CODE] | |
Re: You already check to see if the word has 3-6 characters. Also check for an ' too before inserting the word. | |
Re: First, after entering the number, calculate the number of days. With what's left after removing the number of days from the number, calculate the number of hours. Keep going until you get the seconds. | |
Re: [QUOTE=bflack;]//Why did the compiler treat it as a function...[/QUOTE] Because it IS a function. [QUOTE=bflack;]... and are the header files lacking or what?[/QUOTE] No, you are lacking the header file. But why do you want to use a non-standard C function when a standard C++ function works just fine? Use … | |
Re: Who's teaching these people computer lingo???? [QUOTE=Leppie;]My program runs a three dimensional maze (3x3x3 = 27 locations)...[/quote] No, it [I]creates[/I] a maze. It doesn't [I]run[/I] anything. [QUOTE=Leppie;]... the start and exit rooms show up on the run compiled program ...[/quote] A "[I]run compiled program[/I]?" What the heck does that mean? … |
The End.