15,300 Posted Topics
Re: Because you declared the structure within the body of the class you have to use the class scop operator when referencing the structure. Its not necessary to use the struct keyword. [icode]Blah::Values *getValues();[/icode] | |
Re: something like [code] if( num < 0 || num > 100) { cout << <message to user> return 1; } [/code] But normally instead of just exiting the program it should loop back and prompt for input again. | |
Re: if you are using gcc for *nix or ms-windows, then there is no way to do it because those operating systems will not allow it. | |
Re: If its a text file then you have no other choice but to rewrite the entire file. Open original file for read, open another temp file for write. In a loop read a line from input file and if its not the line you want to delete just rewrite it … | |
Re: >>i don't know even how to start writing the code Start here [code] #include <iostream> using std::cout; using std::cin; int main() { // put your code here } [/code] First, you need to declare the matrix. How many dimensions does it have (2, 3, 4, 5, ...) What dimensions does … | |
Re: The only legal way to get them is by spending your $$$ for the Pro edition. The standard edition might support them too, I don't know about that. ![]() | |
Re: There have been lots of threads here about how to clear the screen. [URL="http://www.daniweb.com/code/snippet232.html"]Like this one[/URL] | |
Re: >>range 0000h to ffffh instead of [0,1) 0xffff is -1 not +1 in signed short integer, but unsigned short integer its a pretty huge number -- for exact value see your limits.h header file. With 16-bit compilers a short and an int may be the same size, but on 32-bit … | |
Re: >>>can you help? No -- I have no clue what that program is supposed to do. Don't expect me to read your other threads -- a thread should stand on its own. | |
Re: The problem is line 9: remove the \ (line continuation character) at the end of the line. | |
Re: Look at [URL="http://msdn.microsoft.com/en-us/library/aa448196.aspx"]MSDN[/URL] and it will tell you what header file and library you need for that function. All you had to do was search google for that function and the link appeared as the very first link. Took me all of about 10 seconds to find it. | |
Re: [b]this[/b] is a pointer, [b]*this[/b] dereferences the pointer. So if you want to pass a pointer just don't use the asterisk. [icode] myFunction(this, ©Class);[/icode] That doesn't mean it will solve your problem, but that's how to pass pointers. That looks like a recursive function call, I doubt you even need … | |
Re: you need to use std::stringstream class. It is very similar to fstream but ccreates the result in memory instead of in a disk file. [code] #include <sstream> #include <string> using namespace std; int main() { int a = 4, b = 5, c = 6; string d; stringstream str; str … | |
Re: why is that function not returning the mean ? You don't need that last parametewr [code] double meanOf3(double value1, double value2, double value3) { return (value1 + value2 + value3)/3; } int main() { <snip> double mean = meanOf3(value1, value2, value3); } [/code] | |
Re: you are making a mountain out of a molehill. The President is allowed to use military force when requested by state governors or when the state is unable or unwilling to to protect civil rights and property. I believe LBJ used that authority in the 1960s to assist school desegregation. | |
Re: Since you have the coice of entering either last name, or first and last name, you will probably have to ask for which they want to enter then create an if condition Example: [code] ... int type; char firstname[20] = {0}; char lastname[20] = {0}; cout << "Enter 1) Last … | |
Re: line 8 belongs up between lines 2 and 3. The using statement should appear immediately following all includes and before any functions. line 7: you can't declare arrays without the dimensions. line 12: you have to pass an array. You call it like this: [code] int arr[10]; // an array … | |
Re: Its done something like this: Note: not compiled or tested. [code] node* temp=start_ptr; node* prev = NULL; while( temp ) { if( temp->item == item) { // delete this node if( prev == NULL) { // we are at the head of the linked list, for remove the head start_ptr … | |
Re: sscanf() is a C function, not c++, and knows nothing about c++ containers like std::string, you have to pass it a character array. [icode]sscanf(xx.c_str(), "%c%c %c%c", &fromX, &fromY, &toX, &toY);[/icode] | |
Re: Put another if condition that test count % 5 == 0 | |
Re: what's your question about queues ? Don't just post code and expect us to guess what you want. | |
Re: I hope Sarah does well tonight -- I don't like seeing girls cry. Aside: As you all know (or should know) I'm from St Louis area where the debate is going to be held in an hour or so. The city is filled with cops from all over the state … | |
Re: Are you sure you have the prequisits for that course? It sounds pretty advanced for a beginner. | |
I'm a newbe at this so started the walkthrough. I'm really confused about one statement [url]http://msdn.microsoft.com/en-us/library/k4cbh4dh.aspx[/url] [quote] [b]Adding and Programming Controls[/b] <snip> [b]To Set Control Properties[/b] <snip> 3. Put the insertion point in a space within the <asp:label> tag, and then press SPACEBAR. A drop-down list appears that displays the … | |
Re: Probably [URL="http://www.microsoft.com/express/vwd/"]Microsoft Web Developer 2008 Express[/URL] You should also read [URL="http://www.daniweb.com/forums/thread145124.html"]this thread[/URL], and the threads on the Web Developer's boards. | |
Re: Welcome to DanWeb. >>No jokes about my age, PLEASE! Naaaw. There are several other members including myself who are probably older. We don't discriminate on ancient technology or people :) | |
Re: unistd.h is a *nix-specific file and not supported by Microsoft compilers. I think Dev-C++ might support it though on Microsoft platform. [URL="http://www.google.com/search?hl=en&q=unistd.h+windows&aq=2&oq=unistd."]More links about that here[/URL]. | |
Re: You can only specify one type of loop counter. >>Is this just a bug in the Visual C++ compiler Not a bug. That type a statement is never allowed [code] int a, int b; // error int a,b; // ok [/code] | |
Re: [QUOTE=PPP1;704110]Hello, I am little bit confuse for c and c++. All loops are same in both the languages so why they are different for each other?[/QUOTE] you will find the same similarities in most computer languages and that makes it easy to learn several different languages. | |
Re: [QUOTE=Sci@phy;701472]Actually, that is a list, not a vector. Minor differences, but still. Here's one way (matrix of strings): [CODE=cplusplus] typedef vector<string> row; vector<row> *vec1 = new vector<row>; [/CODE][/QUOTE] That's not managed code, but managed code is probably something similar. | |
Re: You first need to learn how to format your code -- what you posted is a huge mess which I refuse to even try to read. delete use of conio.h and studio.h -- this is a c++ program, not C. | |
Re: line 17: doesn't make any sense. You might as well just delete that line. line 25: you can't copy character arrays like that. Either (1) make name_sel a pointer, then line 25 will work, or (2) call strcpy() to copy the two strings. | |
Re: My guess is that you forgot to include <vector> and/or [icode]using std::vector;[/icode] statement | |
Re: [QUOTE=mark1993;702985]Well i dont see your website link i think it has been removed can pm me the url?[/QUOTE] Your signature: Don't you read the blogs on your own web site? | |
Re: If this is a C program then do not code it in a file with *.cpp extension because the compiler may give some wrong error messages. Rename the file to have *.c extension for better compile messages. line 7: it should be [icode]int main()[/icode] -- you can not leave off … | |
Re: [code] char value; cout << "Enter a letter\n"; cin >> value; if( value == 'a' || value == 'A') { // do something } [/code] | |
Re: We don't do people's homework for them. You write -- we will help. Post what you know how to do then ask questions about the parts you don't know how to do. | |
Re: class Bicicleta must implement all pure virtual methods of its base class before it can be instiantiated. It does not do that, hence the error message. Add the function [icode]virtual float calcImposto() const;[/icode] (identical to the one in Veiculo but without the =0 part) to Biciclets and it should resolve … | |
Re: search the registry for all instances of yahoo then delete the keys that belong to messenger. | |
Re: >>meanwhile the main problem is finding out how to include the header file But the code you posted does it correctly [icode]#include <iostream>[/icode] is all that is needed. The the compiler starts reading your program the #include statement causes it to open up the include file and add its contents … | |
Re: The answers to three questions are just flat out wrong [quote]4. Which line has all reserved words ? if, else, for, while do, switch, continue, break [/quote] [b]while do[/b] is not a reserved word. [quote]8. Select the correct definition for a string variable.[/quote] Both 1 and 4 are correct answers. … | |
Re: OMG either you lied like hell to land that job or your employer is pretty darned stupid for hiring you in that position. >>what causes do u think i need to do, to be able to achieve this. Quit that job and go to college full time to earn a … | |
Re: You are trying to use the wrong getline(). For data type std::string you use [icode]getline(cin, videoTitle)[/icode] | |
Re: yes. You shouldn't use dynamic allocation unless its really needed. Depends on the context of the rest of your program. | |
Re: lines 72, 79 and 127. constructors can't be called directly like that. You have to instantiate an object of type Month in order to call the constructor. One way to fix the problem is to create a set function. [code] class Month { public: ... void set(int month) { if(month … | |
Re: What you posted looks ok, so the problem is after that while loop. If its prompting for more user input, such as a string, then you have to clear the input stream of the '\n' that's still in the input buffer from inputting an integer. See [URL="http://www.daniweb.com/forums/thread90228.html"]this thread[/URL] for how … | |
Re: Just zip up the whole project (minus object files) and attach them to your post so we can test it for you. | |
Re: [code] #include <algorithm> ... ... cout <<[color=red] fixed << [/color]result << endl; // I use this here to see the results of the factorial [/code] |
The End.