15,300 Posted Topics

Member Avatar for rohith_08
Member Avatar for palunix
Member Avatar for syd919

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; }; …

Member Avatar for Ancient Dragon
0
441
Member Avatar for Ketsuekiame

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.

Member Avatar for Ketsuekiame
0
304
Member Avatar for emmajayne

>>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.

Member Avatar for Master Rattley
0
172
Member Avatar for rajsekhar28

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.

Member Avatar for Ancient Dragon
0
126
Member Avatar for indigo.8

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. …

Member Avatar for indigo.8
0
2K
Member Avatar for ftl25

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.

Member Avatar for Ancient Dragon
0
77
Member Avatar for Jsplinter

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 …

Member Avatar for Jsplinter
0
362
Member Avatar for mchandler

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 …

Member Avatar for ithelp
0
113
Member Avatar for camcam08
Member Avatar for watery87

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 …

Member Avatar for zerocool21
0
103
Member Avatar for ellenski

[URL="http://en.wikipedia.org/wiki/Binary_search_tree"]Maybe you should study this wiki article[/URL]

Member Avatar for ellenski
0
199
Member Avatar for cpp.coder37

[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.

Member Avatar for ~s.o.s~
-6
231
Member Avatar for SoulMazer

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]

Member Avatar for SoulMazer
0
318
Member Avatar for mjmythili

>>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 …

Member Avatar for Ancient Dragon
0
885
Member Avatar for SoSm

You mean a web site like [URL="http://www.shareware.com/"]this one[/URL]?

Member Avatar for Lusiphur
0
128
Member Avatar for EricMack

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 …

Member Avatar for EricMack
1
951
Member Avatar for helpme87

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 …

Member Avatar for helpme87
0
156
Member Avatar for mrkaran

flex++ is not a c++ compiler. So anything you post in this forum about flex++ is useuess.

Member Avatar for Rashakil Fol
0
98
Member Avatar for VanessaRyan

Looks like a giant kite :) I wonder how many birds will just fly right into it.

Member Avatar for bluewombat
2
453
Member Avatar for nbaztec

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 …

Member Avatar for mrnutty
0
573
Member Avatar for Nandu Das

That is how to declare a two dimensional character array. [URL="http://augustcouncil.com/~tgibson/tutorial/arr.html"]Here is a short tutorial[/URL]

Member Avatar for aman rathi
0
118
Member Avatar for Lukezzz

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.

Member Avatar for Lukezzz
0
752
Member Avatar for Shikhin

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.

Member Avatar for Shikhin
0
182
Member Avatar for drjay1627

Depends on the c++ class. If the queue object is protected or private, then I'm afraid not.

Member Avatar for vijayan121
0
129
Member Avatar for therobot

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.

Member Avatar for Ancient Dragon
0
90
Member Avatar for PaKmAn

>>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.

Member Avatar for Ancient Dragon
0
119
Member Avatar for NickDX

You can not add a Form to a pure win32 application program. They can only be added to a CLR style project.

Member Avatar for Frederick2
0
188
Member Avatar for johnnyturbo3

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.

Member Avatar for johnnyturbo3
0
333
Member Avatar for r14r

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 …

Member Avatar for sundip
0
118
Member Avatar for gahhon

>>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 …

Member Avatar for ciint
0
119
Member Avatar for elsiekins

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].

Member Avatar for elsiekins
0
113
Member Avatar for jephthah

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.

Member Avatar for characteredu
0
175
Member Avatar for lanitooot

[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 …

Member Avatar for lanitooot
0
179
Member Avatar for shinsengumi

>>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]

Member Avatar for Ancient Dragon
0
207
Member Avatar for mehak gupta

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 …

Member Avatar for mehak gupta
0
261
Member Avatar for RouseA

Can't you just put the common files in a library and include the library in each of the projects?

Member Avatar for RouseA
0
341
Member Avatar for ftl25

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", …

Member Avatar for Ancient Dragon
0
106
Member Avatar for AkashL
Member Avatar for Ancient Dragon
0
77
Member Avatar for Garrett2011

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?

Member Avatar for arkoenig
0
533
Member Avatar for gpremium

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()

Member Avatar for Ancient Dragon
0
151
Member Avatar for racoon8995

@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 …

Member Avatar for vijayan121
0
173
Member Avatar for ftl25

>>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 …

Member Avatar for mike_2000_17
0
181
Member Avatar for yoni0505

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.

Member Avatar for yoni0505
0
960
Member Avatar for cgcgames

>>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 …

Member Avatar for kirennian
0
237
Member Avatar for chrysanterus

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]

Member Avatar for abhimanipal
0
126
Member Avatar for cwarn23
Member Avatar for ana_1234

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 …

Member Avatar for ana_1234
0
2K
Member Avatar for escortcosworth

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.

Member Avatar for escortcosworth
0
89

The End.