2,045 Posted Topics
Re: I just noticed you changed your custom user title, cwarn and I was reminded that I never replied to this thread. Still really enjoy the show though I don't own any of the DVDs (I watched through the series on TV Land about 6 years ago). Richard Dean Anderson showed … | |
Re: What have you tried so far? It will be helpful to know the layout of the input file also. | |
Re: You're going to have to be a bit more specific. What display are you talking about? By "my C language program" do you mean your IDE or some code you have written? | |
Re: Geez Happygeek, [I]everybody[/I] knows the [I]real[/I] Johnny Depp was taken and placed into hiding in a secure facility 5 years ago. The stand-in is a convincing replica but if you know your "21 Jumpstreet" you can clearly tell it's a fake. So even if he did "die" rest assured that … | |
Re: Don't overbook it, don't provide the "scratchy towels" (a la Verizon ad) and make sure it remains an "ool." On a more serious note, what ideas have you had thusfar? It's going to be quite similar to any kind of hospital management in terms of having people as an object, … | |
Re: Think of it as an extra layer of misdirection :) If you code in any kind of organization (or even if you don't), you will inevitably have 180 different Print methods in different classes, some of which will be named Output (just for sake of argument). Now say 16 divisions … | |
Re: Function definitions belong [I]outside[/I] of main(). One style is to put prototypes before main and definitions afterwards, or you can just put the definition before without needing a prototype [code] void myfunc(int, int); int main() { } void myfunc(int param1,int param2) { } [/code] | |
Re: What does the layout of the file look like, for instance are: [code] inputFile >> appleP; inputFile >> teaP; inputFile >> coffeeP; [/code] appleP, teaP and coffeeP all separated by space or a newline? I suspect if they are laid out like the 2 line sample you gave you are … | |
Re: line 164 in songs.cpp library->push_back(*newSongInfo); line 171 in songs.cpp playlist->push_back(*newSongInfo); You needed to deref library and access member push_back so that needed to be changed into an arrow and since your newSongInfo was a pointer to song and your vectors held songs you needed to dereference that also. Same applies … | |
Re: Your for loop is problematic. When i =0 it gets stuck since temp[0] !='h' is true. Try [code] int count = 0; while(temp[count] != 'h' && count<temp.size()) count++; [/code] | |
Re: While loop runs while the condition is true. Hence, if you want it to stop running when one or the other goes under zero you need an &&. It's counter-intuitive at first but just do a quick truth table [code] cond1 cond2 && T T T (loop continues) F T … | |
Re: It doesn't seem like you are taking in your coefficients properly. If you are going to do it the way you are, you need to expand the while loop around the statements where you get a new a and term each time. Otherwise you're using the "a" you read in … | |
Re: I'm a bit confused about the multimap aspect. OP has a list of names, there's no real pairings (there just happens to be two names to search for). There are certainly more diverse search options available but I wouldn't change data structures completely unless you know it will save more … | |
Re: Unfortunately you don't show us the add() method itself. Does it make sure that the last pointer is not null? Does it create a head at the beginning if there's not one? | |
Re: [icode] Clipboard::SetDataObject(copyString);[/icode] See [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.clipboard.aspx"]this[/URL] EDIT: Beaten again by AD ^^^^ | |
Re: > when I call blob_detect() which uses included .cpp > function which calls .cpp files I'm a tad confused about what you mean by that. Are you saying that you've included the source for the method in another file in your project? Also while there is still editing time on … | |
Re: [code] private void button1_Click(object sender, EventArgs e) { //http://dotnetperls.com/filename-datetime string fName = string.Format("myfile-{0:yyyy-MM-dd_hh-mm-ss-tt}.txt", DateTime.Now); using (StreamWriter sw = new StreamWriter(fName)) { sw.WriteLine(textBox1.Text); sw.Close(); } } [/code] I found the way to get the formatting into one that is acceptable to file names on that site in the comments. Otherwise you … | |
Re: What is the layout of the file? Do you care about periods and commas? [quote]For the assignment we can't use templates or OOP[/quote] Is that a roundabout way of saying you can't use std::string? What approaches have you tried so far? | |
Re: How far can you get in the process? Can you open up a file? Do you want to read it straight out of the file into one big string to put it in the message box? Try to see how much headway you can make first and then post whatever … | |
Re: Just a couple of changes: [code] my_file.open ((getname()+ext).c_str()); // need a c-string for this //you can delete { that was on this line and its match if (my_file.is_open()) //this is ok, included just for context { while (getline (my_file,line)) { //see post #7 where Lerner explained [/code] With those changes … | |
Re: You don't need to put the return type of the function before its name when you are calling it (definitely need it in the prototype and in the definition though) [icode]reverse(s,i); [/icode] is all you need on that line you have marked. Also, you should put [icode] int [/icode] in … | |
Re: Also, see this [URL="http://www.daniweb.com/forums/post1109896.html#post1109896"]post[/URL] and for an article with lots of examples, see [URL="http://www.embedded.com/story/OEG20010311S0024"]this[/URL]. (sorry adatapost, I was already in process when you posted) | |
Re: [icode] constructArray_2 (a, MAX);[/icode] You are passing in the value a to your function but there is no a defined in main(). Where is this value supposed to come from? | |
Re: Check out what adatapost was trying to show you, or you can even look in your error message: [code] /usr/include/iso/math_iso.h:63: note: candidates are: [COLOR="Green"]double pow(double, double)[/COLOR] /usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/../../../../include/c++/3.4.3/cmath:361: note:[long double std::pow(long double, int) /usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/../../../../include/c++/3.4.3/cmath:357: note: float std::pow(float, int) /usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/../../../../include/c++/3.4.3/cmath:353: note: [COLOR="Green"]double std::pow(double, int)[/COLOR] /usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/../../../../include/c++/3.4.3/cmath:349: note: long double std::pow(long double, long double) … | |
Re: [URL="http://www.koders.com/c/fidF32B21FD44F4380CF960E12A27EE12EE861640DF.aspx"]Here[/URL] is the source. Might not be too much trouble to adapt it. | |
Re: I'd put it in a 2D array. That way you can iterate over the rows and pick a random die face from each to face "up". Making your swaps with 16 different arrays could turn into a nightmare. I don't have too much to add besides that. Sounds like a … | |
Re: Did you mean to put M instead of r in your macro? | |
Re: Something like this will work [url]http://pdcurses.sourceforge.net/[/url] (the header alone won't do you any good without the libraries anyway) | |
Re: A few thousand folks have already been at it for quite some time: [url]http://www.loebner.net/Prizef/loebner-prize.html[/url] [quote] Also does anybody know where I can download a mysql database containing a row for every word in the english language and a second column for weather each word is a noun/verb/adjective etc. [/quote] Check … | |
Re: From: [url]http://developer.kde.org/~wheeler/taglib/api/classTagLib_1_1FileRef.html[/url] I've never used this library but it seems like you need a file pointer (FILE * like from [URL="http://www.cplusplus.com/reference/clibrary/cstdio/fopen/"]fopen[/URL]) for the constructor taking 1 argument. The 3 argument constructor seems to take a filename. When you eliminate the parameter from FileRef you are evoking the default, so itwould … | |
Re: [quote]3. How can l add a commend after each prompt that if it is not the same as the the (getinput=="~~~") it goes back to the start?[/quote] Can you clarify what you mean by this? | |
Re: If you are not allowed to use the Standard Template Library (STL) a big hint is that you can treat a string as an [I]array[/I] of characters. EDIT: To your last question, you have to [iCODE]#include <algorithm>[/iCODE] for that to work. | |
Re: You're missing a return value (in the generic sense) which in this case happens to be the variable value. Put in [icode]return value;[/icode] between lines 26 and 27. Not as critical, but you never use the parameter of the function for anything. | |
Re: When you are choosing the type of project in the beginning are you doing Win32 or CLR/Winforms? Also, during that project selection process did you check the box saying empty project? If you check that many settings will not be correct without manually changing them. | |
Re: [sarcasm] No he and his wife don't get out much. [/sarcasm] [url]http://www.gatesfoundation.org/Pages/home.aspx[/url] and from Wikipedia: "The Bill & Melinda Gates Foundation (B&MGF or the Gates Foundation) is the largest transparently operated[5] private foundation in the world, founded by Bill and Melinda Gates." | |
Re: 1.) Find some tutorials on the web (read and reread the 'Starting C' sticky thread in this forum 2.) Get a book with lots of examples 3.) After you've started writing some code, post back with your attempt and people will be able to help you I always find it … | |
Re: If you set it up like tkud recommended (his second approach), it looks like you might have wanted to compare [icode]if(ret !=0)[/icode], right? However, a (somewhat) brief explanation of what the compiler was trying to tell you: Your class must overload the != if you are going to use it … | |
Re: In the first example with [iCODE]cin >> age;[/iCODE] Say you type in 20 and Enter. 20 gets read into your int and the newline ('\n') from the enter remains in the input stream. getline is designed to read until a newline occurs (which it reads and discards), so as it … | |
Re: You need to add currentMonth to your private variables list up in the declaration. You currently have [icode] string month[20]; [/icode] which is giving you an array of 20 strings. So either change "currentMonth" to "month" in your setMonth method or declare currentMonth up with the other private variables and … | |
Re: I'm not sure what you mean when you speak of converting negative numbers. A negative decimal number is represented in the computer by a system called Two's complement (see [url]http://en.wikipedia.org/wiki/Two%27s_complement[/url]). In order to find the 2s complement you toggle the bits of the binary representation (1-> 0 and 0->1) and … | |
Re: I would drop the istringstream it's complicating things when it's not really necessary. I changed a couple of lines in your code, specifically the while loop condition [code] while(fin >> x >> y >> z) { row.push_back(x); row.push_back(y); row.push_back(z); //... rest is the same } [/code] And added: [icode] cout … | |
Re: What are some of the ideas that you have had? How would you try to do it if you had to? EDIT: Shawn nice idea in principle but unless OP is doing right triangles... @OP: How could you get the tangent knowing the other two? | |
Re: [quote]I have copied the exe found in the debug folder[/quote] A little late on my part as the discussion has shifted but it's probably worth noting that you definitely want the Release build exe and not the Debug version as it debug has all of the extra luggage (debug info) … | |
Re: You need a ; on the end of your class declaration. [code] class expenses { }; [/code] You have it right that "getters" return something but you need to indicate that on their declarations and definitions (i.e., what are they returning-- they're not void). You need to [I]just[/I] get the … | |
Re: Look under: Project Menu/Properties/Configuration Properties/General/Output Directory I think this is to what you are referring. Also see Project Menu/Properties/Configuration Properties/Debugging/Working Directory I'm not sure what the exact distinction between those two is, but the latter might let you just specify the directory for the dlls without having to spawn the … | |
Re: Sold separately? Goes with: Batteries not included. Some assembly required. You need at least 2/3 of those to qualify for a 1980's toy commercial. [quote] So rather than your recipient think you're being sarcastic, they instead think you're an idiot who can't use a keyboard. [/quote] "nt nlik ne1 els … | |
Re: Datafile, etc. in `main()` bear no relation to the names you have given to your parameters in your method definitions. Just make a variable of `datatype OUTPUT_t` and one of `DATAFILE_t` within the body of `main() `and pass them into your methods. These variables are being passed in by reference … | |
Re: When you select a project go for Win32 Console Application, deselect precompiled headers and leave empty project unchecked. That usually takes care of it. I'm behind on the times as I don't have the latest and greatest yet but seems to me most of that is unchanged. | |
Re: Break it down without the constants. You've declared an array of size 30 up above and you're trying to access the element #30 on lines 76-81. Except the index of element 30 is not 30, it's 29. Nonetheless even if you had the proper index, you are reading into your … | |
Re: See post #6 of this thread from the Ubuntu forums: [url]http://ubuntuforums.org/showthread.php?t=976202[/url] |
The End.