15,300 Posted Topics
Re: yes -- post your code and we will help you with the problems | |
Re: Either Code::Blocks or VC++ 2010 Express, both are free. | |
Re: Trying to do that with multiple arrays is not a good idea because its difficult to keep the data together for any given city. A more convenient way to do it is to create a structure for the data [code] struct city { std::string name; int x; int y; }; … | |
Re: I don't see SHOWERROR anywhere in the code you posted. SAFE_DELETE is not really needed because delete and delete[] work correctly when the pointer is a NULL pointer. So there is no need for those two macros. | |
Re: >>please could you help me? That's like asking "my car is broke -- can you fix it?" A mechanic will need to know a little more details about your car, such as make, model and year. | |
Re: The function that calls the one you posted has to pass a pointer by reference, hence there are two stars not just one. If it did not do that then SortedInsert() would be unable to change the linked list declared in the calling function. | |
Re: That will not get you the number of bytes you need to allocate for the character array. What that does get you is the number of integers in the file. Those are two different things. Each digit in the file will take up one character in the unsigned character array. … | |
Re: Sounds like the program is blocked waiting for some hardware interrupt. If those are your DLLs then debug them to find out what is is doing. Otherwise your question is just too vague for anyone to describe the solution. | |
Re: Since you are using precompiled headers, stdafx.h must be the first include file in stdafx.cpp and all other *.cpp files of the project. Other *.h files can be included after stdafx.h and will not be included in the *.pch precompiled header file. I don't think that is the problem though … | |
Re: Not illegal as long as you don't take their program and call it yours. Make your program a little different than others already on the market and you should not have any legal problems. But you will want to do a lot of market research to see if there is … | |
| |
Re: What does get_line() do? Does that function also read a line from the file? If it does then your program is reading two lines at a time before doing anything with them. [code] void readData () { FILE * pFile; NoOfRecordsRead = 0; char buffer [Line_Char_Buffer_Size]; pFile = fopen (INPUT_FILE_NAME … | |
Re: [URL="http://en.wikipedia.org/wiki/Binary_search_tree"]Maybe you should study this wiki article[/URL] | |
Re: [QUOTE]Who the hell can stop me from posting a topic multiple times[/QUOTE] What an absolute moron. He sounds like a 5 year old who isn't potty trained yet and stll breast feeding. | |
Re: static class objects also have to be declared globally in a *.cpp file [code] // Node.cpp #include "Nodes.h" #include <list> // declare the static object globally std::list<Node> NodeManager::node_list; void generateNodes() { Node n1(1, 346.0, 26.5, -470.0); n1.children.push_back(2); n1.children.push_back(4); n1.children.push_back(5); NodeManager::node_list.push_back(n1); // defining more nodes } [/code] | |
Re: >>Is it possible to find the no. of elements in an array after inserting without counting while insertion depends. For statically allocated arrays see andor's response. Otherwise, it is not possible because c arrays do not keep that kind of information. If you are using C arrays and the array … | |
Re: You mean a web site like [URL="http://www.shareware.com/"]this one[/URL]? | |
Re: Let the US Federal government impose the tax consistently throughout the USA and its posessions, then make quarterly payments to the individual states based upon their representation in the House of Representatives. That means all consumers will pay, for example, a 5% sales tax regardless where they live (USA or … | |
Re: The way I do it is to first call time() and localtime() to get the data as struct tm. Then use sprintf() to format the date into a character array [code] char date[40]; time_t now = time(0); struct tm* tm = localtime(&now); // now format the date -- I put … | |
Re: flex++ is not a c++ compiler. So anything you post in this forum about flex++ is useuess. | |
Re: Looks like a giant kite :) I wonder how many birds will just fly right into it. | |
Re: Some of those questions may be true or false depending on the version of c and c++ standards. But current c/c++ standards are like this: >>In C program , the MAIN() should NOT RETURN a value That's a lie, and has always been false. Either you misunderstood him, or it … | |
Re: That is how to declare a two dimensional character array. [URL="http://augustcouncil.com/~tgibson/tutorial/arr.html"]Here is a short tutorial[/URL] | |
Re: You only need one file -- the *.exe file. All the other files you see are just integmediate files used by the linker to build the *.exe file. You could have easily tested this yourself by copying the *.exe file somewhere else and executing it from Windows Explorer. | |
Re: You need to learn how to use your compiler's debugger so that you can single-step the execution of the program and see for yourself what is causing the problem. Hint: line 89 is in the wrong place. | |
Re: Depends on the c++ class. If the queue object is protected or private, then I'm afraid not. | |
Re: When you distributed the final program all you give them is the *.exe or *.dll, whichever type your compiler builds. You do NOT give them the source file -- *.h, *.c, *.cpp or *.lib. | |
Re: >>I think I understand creating a multiplication table without an input Not much different. Post how you would do it without input and we'll show you what you need to change to make it work with input. | |
Re: You can not add a Form to a pure win32 application program. They can only be added to a CLR style project. | |
Re: The maximum length of a std::string is about the same as the maximum value of an unsigned integer, which is pretty darned big (see limits.h -- 4,294,967,295 on my compiler). Its highly unlikely your query will come even close to that number of characters. | |
Re: One way to do it is to do two finds [code] size_t found1=0; size_t found2=0; found1 = aDir.find_first_of(search_char); cout <<"@ is found at:"<<found1<<endl; if (found1!=string::npos) { cout<<"now :"<<aDir <<endl; found2 = aDir.find('-', found1+1); aDir = aDir.substr(0,found1) + aDir.substr(found2-1); } [/code] Of course you may need to do it a little … | |
Re: >>can we use the continue statement in if-else statement? No >>i know the continue statement only can use under for loop right? No. Can also be used on do and while loops. pseudocode [code] set loop counter to 0 beginning of loop increment (or decrement) loop counter if loop counter … | |
Re: named semaphore is [URL="http://linuxdevcenter.com/pub/a/linux/2007/05/24/semaphores-in-linux.html?page=4"]here[/URL] for *nix. [URL="http://visual-c.itags.org/visual-c-c++/179147/"]MS-Windows example[/URL]. | |
Re: I used Sears & Roebuck catelog for toilet paper when I was a kid growning up on the farm. We didn't have running water in those days. | |
Re: [quote] Hardware Requirements: - Computer that has a 1.6 GHz or faster processor - RAM: 1 GB RAM for x86; 2 GB RAM for x64; An additional 512 MB RAM if Visual Studio is running in a Virtual Machine - 3 GB of available hard-disk space - 5400 RPM hard … | |
Re: >>cardslist(); //is this the right way to call cardslist? Functions must be declared before they can be used. [URL="http://opencbp.sourceforge.net/en_US.ISO8859-1/books/opencbook/func.prototypes.html"]Read this link[/URL] >>card[0].name = "geezard"; //errors occur from this line onwards You can't assign a string to a character array like that. Either make name a pointer or use strcpy() [icode]strcpy(card[0].name,"geezard");[/icode] | |
Re: how to invoke another process is operating system dependent. fork() creates another process from the currently running process, it does not invoke a new process that is not currently running -- and its only supported by *nix machines.. system() as suggested by dave is supported on all (or most) operating … | |
Re: Can't you just put the common files in a library and include the library in each of the projects? | |
Re: There is no reason why this should not work, unless the function DIAG_ReadMem32 is attempting to change the contents of either of those pointers. [code] char *sCmdInt[8] = {0}; sCmdInt[0] = "123"; sCmdInt[1] = "234"; DIAG_ReadMem32(sCmdInt[0], sCmdInt[1]); [/code] If the values in the array are hex numbers, such as "0x100", … | |
Re: [URL="http://lmgtfy.com/?q=multithreading+books"]maybe these threads[/URL] | |
Re: c++ was derived from C, and C never ha them either. What would be the purpose of a nested function? What features could nested functions give you that normal functions do not? | |
Re: You can't use strtok() on a const char* because strtok() will change the contents of the string. Copy the const char* into a buffer and use that for strtok() | |
Re: @firstPerson: That's because YOUR compiler lets you do that. vc++ 2010 will not. @Sky: You still have to include the header file for your version of the string slcass. So its not even "technically possible". You need to include the string header file regardless of whose class it is (or … | |
Re: >>I can't use iostream (not linux compatible) Who the hell told you that lie? (its just a rhetorical question, not meant to be answered here) So you mean that you are really writing a C program, not c++. In that case std::map and std::string can not be used. As for … | |
![]() | Re: The problem really isn't how to include windows.h but how to get the HDC parameter that most win32 api graphics functions require. I don't know how to get that either from managed code. ![]() |
Re: >>if (Gavity.Text == 'Heavy' || 'Normal' || 'Low'){ That isn't a c++ legal statement, manage or unmanaged. [icode]if( Gavity.Text == "Heavy" || Gavity.Text == "Normal" || Gavity.Text == "Low"){[/icode] I created a simple Forms application with a combo box and a text box, then copied the selected item in the … | |
Re: Sample basic code? This is about as basic as you can get [code] #include <stdio.h> int main() { printf("Hello World\n"); return 0; } [/code] | |
Re: In Alphasort() you strcmp() is NOT case insensitive. You need to use a case-insensitive function, such as stricmp() or strcasecmp(), depending on the compiler you are using. Or you could write your own compariso function by copying both strings into a temp variable, convert each to all UPPER case then … | |
Re: You need to modify function parameters to pass them by reference instead of by value so that the changes made by the function can be seen by the whoever called it. [icode]void readData(ifstream &fin, double &sidea, double &sideb, double &sidec)[/icode] Now do something similar with the other functions. |
The End.