5,676 Posted Topics
Re: Given that, another option is to have an array, one entry for each alarm. Option 1: When a value is received, [code] 1) if array entry = 0 a) print the alarm b) load 20 into the value 2) if array entry <> 0 decrement the array value [/code] This … | |
Re: Never claim your question is [I]urgent[/I]. Many people here will completely ignore any post that has that word in it. No question is ever urgent posted here. We'll answer it when we get to it. You're just lucky this time... As for your problem, [url=http://www.gidnetwork.com/b-58.html]see this[/url] Don't blindly output your … | |
Re: You need to [url=http://www.gidnetwork.com/b-58.html]read this about feof()[/url]. | |
Re: Create a vendor class, a customer class, an item class, and an order class. Then decide on how they interact (which class connects to which class) and write the code that connects them. | |
Re: Plz rd da rulz uv da forum, an da stickies at da top. Stop using baby talk, we are adults here. And we are not a free homework service. | |
Re: You basically have to 1) create both months at the same time or 2) use a 2d array and load the calendar into the array. When done, print the array. | |
Re: First question: Is this equation really supposed to return a julian date? [icode]julianDay = day1 + (153 * m + 2) / 5 + y * 365 + y / 4 - y/100 + y/400 - 32045;[/icode] It might help if [ICODE]getDayNumber()[/ICODE] [I]return[/I]s the value calculated. | |
Re: [QUOTE=Peyton;855960]Hi again, After doing what you said, I bumped into another problem. [/quote] It's not nice to [I]bump[/I] on a forum :D You cannot create an array nor matrix using variables for its size. | |
Re: Green adds points to reputation. Red subtracts. Grey, no change to rep points. It's because the person that gives rep doesn't have enough posts that actually affect someone's rep. | |
Re: 1: Zero your [I]Total[/I] 2: Read the input as a string (hex) 3: Check each character and conve rt it into decimal value (A=10, B=11, etc) 4: Multiply [I]Total[/I] by 16 and add the above value 5: Back to 2 | |
Re: [QUOTE=AnujSuper9;853641]Hello everyone, I'm working on a small assignment where I am supposed to write the code for the itoa function [icode]char* itoa(int Value, int Base);[/icode] without using any built-in functions, and where the returned value is allocated on behalf of the caller. Value being the integer to convert, and base … | |
Re: Iterations is the number of times to do the calculation. You use it correctly in your code: [code=cpp] cout <<" On how many iterations? "; cin >>i; for (long int n = 1; n <= i; n++) { [/code] | |
Re: [QUOTE=niek_e;853780]press ctrl-f in one of your threads and type: Mark as Solved. It will show you link that is just above the (purple in this case) "quick reply to thread" bar.[/QUOTE] Ctrl-F brings up the [I]FIND[/I] dialog in FFox and IE. At least for me... | |
Re: [QUOTE=moiron;847756]you mean the index = 0; i seriously don't know what that means. i have seen it before but i don't know what it does and which loop do i use? For loop? and how do i add the contents of my array[/QUOTE] If you don't know what [ICODE]index = … | |
| |
Re: Did you somehow fail to read all of the information posted all over this site about CODE tags, like 1) in [url=http://www.daniweb.com/techtalkforums/faq.php?faq=daniweb_policies]the Rules[/url] you were asked to read when you registered 2) in the text at the top of this forum 3) in the announcement at the top of this … | |
Re: Somehow I don't think this compiles. In my compiler: [code] Error E2268 x.cpp 15: Call to undefined function 'count_file_values' in function main() Error E2313 x.cpp 16: Constant expression required in function main() Error E2451 x.cpp 18: Undefined symbol 'cout' in function main() Error E2268 x.cpp 22: Call to undefined function … | |
Re: [QUOTE=cassie_sanford;852204]I have 2 functions: one has to calculate the total number of days spent on a trip and the other has to calcualte the time of departure on the first day of the trip and the arrival back home on the last day of the trip. [/quote] OK, so far … | |
Re: Look at the header [B]ctime[/B]. All the time functions are there. A Google search should give you definitions and explanations. | |
Re: Your first attempt was [I]much[/I] better. Writing functions is the way to go, as you were doing. Don't follow [B]nucleon[/B]'s advice. Do not use [ICODE]scanf()[/ICODE] to read strings. [url=http://www.gidnetwork.com/b-62.html]Here's why[/url]. Don't use [ICODE]feof()[/ICODE] either. [url=http://www.gidnetwork.com/b-58.html]Here's why[/url]. Tell us the following: 1) What is a stack? 2) How can a stack … | |
Re: Here's a guy that was living on that forum RSS # Total Posts: 3,444 # Posts Per Day: 127.73 * Last Activity: 03-26-2009 03:03 PM * Join Date: 03-26-2009 * Referrals: 0 Looks like their bookkeeping needs some updating... | |
Re: What integer is '|'? That looks like a character so you cannot read it into an [I]int[/I] variable. To do what you need you'll have to read the input as characters. If you get a number, convert it to an integer. If it's not a number, do what you need … | |
Re: [QUOTE=sharensla;851244]u should have to use cin instead of cin.get because cin.get mostly used in case of string use cin as below char choice[5]; cout<<"ENTER YOUR CHOICE"<<endl; choice=getche; switch(choice) case '1': sum=a+B; break; case '2': multi=a*b; //up to 5 choices and then default choice[/QUOTE] I'm at a loss. You say "[I]u … | |
Re: Why doesn't it compile? Don't you have a compiler? If you do, did you get errors? If you did, are we supposed to [I]guess[/I] what they are? | |
Re: Start by changing each line in the pseudo code into real code. Use the correct syntax for each command you use. Then add code before this conversion to add the things needed to make it compile -- like variable/array definitions, main(), header files, etc. | |
Re: This is a perfectly legitimate question for this forum. It's about reading special key sequences. The hardware is just a red herring in this case :icon_wink: 1B 5B 41 is called an escape sequence. In this case [ICODE]ESC [A[/ICODE]. So... When you read a 1B set a flag that remembers … | |
Re: [QUOTE=Ancient Dragon;844664] Or little green monsters from Mars ???[/QUOTE] Just play Slim Whitman songs.... | |
Re: You opened [i]filein[/i] and you're reading from [i]cin[/i]. | |
Re: Boy, you guys just don't understand. Birds don't [I]live[/I] in the sky. They land to sleep, they land to have their birdlets, they live most of their life not flying! As for the video -- what the heck was that about?!?!? :confused: | |
Re: We can just get the code from [url=http://babelfish.yahoo.com]Bable Fish[/url] and modify it to properly format the translations to be syntactically correct for the new language. Should be trivial... :icon_twisted: | |
Re: And when you [INLINECODE]strcpy(String, "abcdefghijklmnopqrstuvxyz")[/INLINECODE]; into a 26 character array like this you just blew past your array bounds because a 27th character (\0) is loaded too. Remember, a [I]string[/I] in C always ends in \0 and that [I]must[/I] be accounted for in the buffer. | |
Re: [QUOTE=greg022549;842573]In this daniweb site, is there a way to search for a particular item. Example: I want to see what a solution may be for ssolving temperature? If so, how do I search all the threads for that. Just curious![/QUOTE] Umm, try typing in the particular item in the search … | |
Re: Because we already got our grades and passed the course. You can't pass using our work. You need to pass on your own work. | |
Re: > Same. I always just type quote and quote I just hit *Reply w/Quote* and let the system add the quote tags with the quotee -- without the spacing or periods.... :icon_wink: | |
Re: Keep in mind that when you have a 'string' as an answer -- for example [icode]5' 2 3/4"[/icode] -- each of these answers will be wrong: [icode]5', 2 & 3/4" 5' 2 3/4" 5' 2 3/4" 5 ft, 2 3/4 in [/icode] IOW, a string input may not be a … | |
Re: And to prove that he's an..., try this: [code=cpp] #include <iostream> #include <fstream> using namespace std; int main() { char line[80]; ifstream inFile("x.x"); while (!inFile.eof()) { inFile >> line; cout << line << ' '; } inFile.close(); return 0; }[/code] Use this file: [code] ONE two Three [/code] What just … | |
Re: [QUOTE=austinslik;428722]please help me in finding what is wrong with my array... its not sorting thanks, thanks. [/QUOTE] First, what [B]Ancient Dragon[/B] said is correct. Second, your sort needs [I]two[/I] loops, not one. Look at the description or algorithm of the sort again. Your code should be moving the highest value … | |
Re: What you are attempting to do can be done with arrays. [QUOTE=wasge;834577]Imagine you have an integer variable called "number" with a number, and when you executes a function, this function creates a variable called "audio1" and increments number (number ++; ). The next time this function will create another variable … | |
Re: Start by defining two arrays, first to hold the values and second to hold the vowels themselves. Then use loops to check the input characters with the letter array and increment the correct value in the other array (or define a 2D array to make it easier). Then for the … | |
Re: [QUOTE=Comatose;827235]Well, the moderators who are supposed to strip those posts out would need to keep saging off.....[/quote] Moderators are not supposed to strip posts out [QUOTE=Comatose;827235]posting new questions in old threads isn't supposed to happen (or receive any kind of answer other than "how 'bout you post a new thread") … | |
Re: Just use an index into the array and output one character with [icode]putchar()[/icode] at the correct screen location. | |
Re: [QUOTE=shamila08;830297]Hello..... i got a problem where my output are repeated..... how to solve this problem....[/QUOTE] [QUOTE=SeeTheLite;830303]Er nevermind, couldn't see that last bracket.[/QUOTE] Good. I'm glad you got it because you didn't tell us what the problem was which makes it hard to help you to solve it. | |
Re: [QUOTE=SeeTheLite;830146]Tag a system("pause"); before return 0; and see what happens. [/QUOTE] You might want to read [url=http://www.gidnetwork.com/b-43.html]this[/url]. | |
Re: When you read a file that's a directory, call the function again. And learn to use CODE tags. There are at least 6 places on the site they are explained. | |
Re: Resurrecting a 5 year old thread to ask us to [I]give[/I] you a free grade is frowned upon. | |
Re: [QUOTE=RexxX;817583]What way(s) can I reread the same file in C? I've only been able to find C++ tutorials. I tried: [code] fclose(infile); infile = fopen(argv[1], "r"); //error checking [/code] but this code didn't go to the beginning of the file.[/QUOTE] Any time you open a file you are automatically at … |
The End.