342 Posted Topics
Re: I would put the variables in their own parenthesis's. (x1-x2) . This looks like it might be some asymptotic equation. So the question is if the difference will EVER be less than that value. Otherwise you might be waiting a very long time for the loop to terminate. | |
| |
Re: ...and the address where we should send the completed assignment! I live only to enhance your available"party time". | |
Re: It's telling you that it can't find the the first file. You probably need to enter the path in the IDE Second, it saved details of the build attempt in the path specified. | |
Re: [QUOTE=technogeek_42;522002]i know that is for c++ but can i ask what is the code of this in vb6?[/QUOTE] Good GOD man! THIS IS A C++ board! When in Rome... | |
Re: your compiler should tell what lines they were on. the first two are simple syntax errors Perhaps the 'int' keyword problem is related to the undeclared variable 'numCols' where you ment to write: int numCols; but wrote int int which would give those exact three. Do a string search on … | |
Re: Your question is too vague. For instance, is the sequence always going to linear as in your input sequence 01234567 or does the user have the ability to REALLY mix things up with an input like 90133854 ? If not, then all you would need is the low starting number … | |
Re: [QUOTE=IIMarckus;523005]Hey guys, I just have a simple (?) question. What difference is there, if any, between [inlinecode]cin[/inlinecode] and [inlinecode]std::cin[/inlinecode] (for example)? If the latter is better form, why is it so?[/QUOTE] They are the same. however you must bring the cin into scope by one of these ways: using namespace … | |
Re: CTRL C seems to work in many cases if it's a command line situation. | |
Re: Isn't stuff like that done by setting one variable to zero in order to find the relationship between the the other two, then resubstitute that relationship? You could also do a simultaneous equations matrix. Hope this helps, It's been a while... Hope that helps | |
Re: Those are not C++ libraries. nix all of them. Just use <iostream> (no .h) You will also need : using namespace std; //directive | |
Re: [QUOTE=Ancient Dragon;521953]dir will just tell you where iw3mp.exe is. You have to copy that directory into the next line. Its possible that it isn't even on your computer. I'm using Vista Home Premium and I don't have it in the windows directory.[/QUOTE] You can also use the "find" function that … | |
Re: [QUOTE=Jboy05;521957]Scratches Head:confused: Please have some patience with me im a noob:icon_eek: [B]This is wat the instructions I have to do for IPO[/B] [B]For IPO, [/B] t Absolutely NO C++ code or keyword of any kind should be used (they are not even needed) in Part I of the Assignment. This … | |
Re: I guess the best way to start is to have a clear concept of what you are trying to do. I'm not sure from reading the above, but I think the ultimate goal is to make a "person" array that enters and displays personal data in different formats???? If so, … | |
Re: [QUOTE=programmingnoob;518567]sorry if thats what you think..but i really dont understand it..i still have no idea on how start this..anyone that can give me a headstart with this? i think this is quite a sophisticated and way too hard program for my level...[/QUOTE] It is a sophisticated request. How did you … | |
Re: [QUOTE=dexter1984;518472]Aaaa I see. I tried putting if ( num != 0) into the while loop and it works! Guess I got to do more examples to get the hang of C++ Btw, the program is an example of using the concept of passing by reference right? Thanks ^^ [/QUOTE] No, … | |
Re: > I can't use loop or i will get a deduction > > What i use is ; > > const string fullname= "Horatio Thadeous Hornblower"; > > string firstname; > > string middlename; > > string lastname; > > int spacePos= fullname.find(' '); > > firstname = fullname.substr(0, spacePos); … | |
Re: line 124 looks a bit strange. CatesianPoint is a class, but you are using it like a typedef? | |
Re: I'll second what Ravenous Wolf had to say: All you need to do is display the results! (oops) | |
Re: Here's a tip GOOGLE is your friend. Whenever you have a "lookup" type question, try Google-ing it first . Enter it like this: C++ continue C++ break You may use this method for any lookup question you may have in the future. It doesn't even have to be limited to … | |
Re: use a loop to keep gathering data [code] int sum =0; int tank =0; while (cin.get() !="") cin >> tank; int sum =sum+tank; [/code] I'm not sure about the "" though... | |
Re: Since adding an interest rate to SOMETHING is a similar task for both checking and savings, it could be presented as an overloaded function. Especially if there were conditions placed on the interest vs. balance in the account, would make sense to do it that way. The simplest invocation might … | |
Re: Seems to me that you have a bunch of rouge braces. see commented line below. There is an extra brace between each function! I'm surprised that it compiles this way. Perhaps this is what is confusing the compiler? [QUOTE=legendarya49;511226] [code]#include <iostream> #include <cmath> using namespace std; void addArrays(int array1[], int … | |
Re: The only thing would suggest is to lose the namespace directive and just list what you use using std::cin | |
Re: [QUOTE=greglobal;454529]This method also uses several bitbld methods, so the lag is very high when you try to draw say 5-6 transparent images. Totally, there are 12 bitbld calls which slows down th game considerably. Any other suggestion ?[/QUOTE] Do these images need to move while they are transparent? I know … | |
Re: I am learning C++ myself. looking at this initially, you are using "struct" which has been depreciated in C++ syntax. Secondly, your sort method (I could be wrong about this!) seems that it could give erronous output since ( I believe) it works on comparing ascii value of the names. … | |
| |
Re: [QUOTE=revenge2;443142] please help!!. and what is "int" by the way. I am a little confused[/QUOTE] int = integer which is defining the the variable types, in this case weekdays, as integer variables. You might want to do a little study. This question is almost too basic. Ripping off some else's … | |
Re: > O cout << "The first and third letters in the entered words are: " << static_cast<unsigned char> (list[5].find(list[5], 1, 3)) << endl; cout << endl; } > end quote. I'm drunk at the moment, but I can see a few problems with this code. First, you are out of … | |
Re: Yeah, I think it's called tabbed browsing! If you don't like that, then I guess you'll have to stimulate your creative juices a bit. Anything is possible...IF YOU TRY. | |
hello all, I am trying to compile this canned example in QT4 , but the compiler spews out an error messagethat I have never seen before. The *.cpp file: [code] #include <QtGui> #include "finddialog.h" FindDialog::FindDialog(QWidget *parent) : QDialog(parent) { label = new QLabel(tr("Find &what:")); lineEdit = new QLineEdit; label->setBuddy(lineEdit); caseCheckBox … | |
Re: [QUOTE=gopi kannan;411681]i wrote a program in c ++...when i compiled it..the compiler showed limit=215f #00a5....and the program did not get compiled and the ide got closed...i compiled using turbo c compiler...tell me whatz dis??and how to compile my program??the program is around 500 lines...help me...[/QUOTE] A word of advise... Use … | |
I just started to fool around with QT4. I was wondering how experienced organized the widgets used in GUI's. For instance if I were to use several widget objects in a particular program, is it better practice to make a header file for each function? If I wanted a spin … | |
Re: in the comparison program, the first two prototypes are incorrect. You have the test condition (a,b) which makes no sense. Later on you use it correctly with (a==b). If you took the time to read the compiler errors, you could have noticed this immediately ! I learn allot from compiler … | |
Re: [QUOTE=Bench;407842]You need to put the [CODE] tags around the area of text where your code is To create a derived class which inherits from Bank is as simple as [CODE=CPP]class saving : public Bank { // saving-specific code in here };[/CODE][/QUOTE] Also, I have some general questions about this entire … | |
Re: [QUOTE=hinduengg;400972]I am unable to implement the logic suuceesfully .:sad: So please help !! I really need it.:confused: Hinduengg[/QUOTE] Ok, one code neophyte to another... write the example word JOY on the left side of a sheet: then think of pointing to another "scratch" array. You want the scratch array to … | |
all is not always what it seems. I found out the hard way that there is a very big difference between a copy and a direct assignment . [code=cplusplus] char* a = new char(); char* b = new char(); cin.getline(a,10,'\n'); strcpy(b,a); //ok makes a SEPARATE copy a=b; //This seems to … | |
Re: [QUOTE=iamthwee;402119]Nah, VS is too bloated and c++.net is horrible. For pure c++. i.e no windows GUI crap, you don't need Visual Studio. And anyway, if you are writing code it is best to test it with different compilers and operating systems to ensure portability.[/QUOTE] Even if you write a "Hello … | |
Re: [QUOTE=Nichito;400164]i know i learned it somewhere, but its been a while since i used it... how do you make an user given array size... i mean...[code]int b; cout<<"Input the array size: "; cin>>b; int array[b];[/code] i know this is not hte way of doing it... but just so you get … | |
I added a line to this program to read the length of the the string , then display the test. strlen() is not cooperating! Am I using the wrong function? the compiler says the arg should be char*. I'm confused! [code] #include <iostream> #include <string> #include <vector> using namespace std; … | |
Re: [QUOTE=Ancient Dragon;399008]No it won't. C++ made several syntax changes such as c++ requires type casts where C does not. [URL="http://david.tribble.com/text/cdiffs.htm"]Here is a more complete list of differences[/URL]. One way to make your code more c++'ish is to replace all printf() function calls with cout that is declared in <iostream> header … | |
I was experimenting with a direct method of dereferencing an iterator. It works OK with numbers, cout gets confused (??) when the derefenced pointer is a string? The code was supposed to stuff a vector, then read it out . I hacked up that original to do some troubleshooting and … | |
Re: Wow! That's some scary looking code you've cooked up! Why don't you grab a copy of the c++ primer or some book like it. Go through it completely before attempting something like this. I think you are just going to confuse the hell out of yourself if you keep going … | |
Re: OK, I've got question! If the program is sorting external files, why define time_t t and time(&t)? I don't see them used in the program. | |
Re: I see no definition for public function int SearchCommand() in class FunctionEntry. I suppose that might stop you dead in your tracks! | |
Re: Gcc compiles many lanuages C++ is one of them. I use codeblocks open source IDE on my (fedora) linux box which works great with Gcc and just about any other compliler out there. If you want something more "linux-y" you might look into Vim for just messing around with code. … | |
Re: [code] marks[q] == markofStudent(r); [/code] This should be the assignment operator = the mark of student() function should be int, not void | |
I'm trying to solidify my understanding of some vector concepts. 1) interators are "smart access" in that they can keep track of the array position and size. 2) the access element operator [] is the "dumb" access to the vector. Also, I was experimenting with ways to dump the contents … |
The End.