15,300 Posted Topics
Re: It appear you are declaring the same object in two *.cpp files. That will happen if you declare something in a header file then include that header file in all *.cpp files. What you need to do to corect that is declare it with the [b]extern[/b] keyword in the header … | |
Re: To change the value you have to completely rewrite the entire file. You will have to write the file back out in the same format from the data that is in the Form. | |
Re: allocate and top the string first then reset pointer a [code] char* temp = new char[n]; char* p = temp; memset(temp,' ',n); temp[n-1] = 0; //null terminate memcpy(temp, a, strlen(a)); a = temp; [/code] | |
Re: 1) open the file [code] FILE* fp = fopen("myfile.txt"); [/code] 2) use fprintf() [code] fprintf(fp,"%x", 123); [/code] How difficult was that?? But this is c++, so you should be using the functions in <fstream> [code] #include <fstream> using namespace std; int main() { ofstream out("myfile.txt"); out << hex << 123 … | |
Re: If you want to set all elements to 0 then you can use memset(). Microsoft compilers implement that function in assembly because the chip has an instruction that will do it, and that is about as efficient as you can get. I don't know how other compilers implement it. Also … | |
Re: [URL="http://letmegooglethatforyou.com/?q=c+calendar+program"]Here you go[/URL] | |
Re: If the classes can be plugged into other projercts without change then make a shared library out of them. That way there is only one set of source files and the projects all link with the same library. | |
Re: First you have to populate the two arrays dogs and cats. cin might be useful for that. After that is done then use a loop to sum them up | |
Re: [URL="http://www.codeproject.com/KB/tree/shelltreectrl.aspx"]Here is a start.[/URL] | |
Re: could Sanjay Gupta be any worse than Joycelyn Elders, who was fired by Bill Clinton | |
Re: what is wrong with it? line 37: geta() is a function -- you need to add the () | |
Re: [URL="http://letmegooglethatforyou.com/?q=change+font+in+windows+console"]Read this[/URL] | |
Re: The functions in either stdio.h or <fstream> will do the job equally well, but for c++ most programmers would recommend <fstream> for consistency. If all the characters you want to write are all in one large block of RAM than you would write the file in binary mode, which is … | |
Re: are you looking for a web hosting service? If yes, there are hundreds of them. Just google for it. | |
Re: You can use[URL="http://www.codeblocks.org/"] Code::Blocks compiler[/URL], which is more up-to-date than Dev-C++. | |
Re: try googling because it will answer many of the questions you have. The solutions are not simple, so you will need basic understanding of C and/or C++ languages. [URL="http://msdn.microsoft.com/en-us/library/ms682073(VS.85).aspx"]windows console functions[/URL] [URL="http://support.microsoft.com/kb/99261"]clear windows console screen[/URL] This one I wrote to show how to use FindFirst() and FindNext() win32 api functions. … | |
Re: trimleft() does nothing. After finding the last space you need to shift all remaining characters left. memmove() will do that for you, or you can do it yourself using two pointers. | |
Re: [QUOTE=peter_budo;777200]Question: Who is not looking for good job in these times of depression?[/QUOTE] Not me :) | |
Re: This has been reported before, but I can't find the thread at the moment. As I recall (maybe wrongly) that comment is intentional. | |
Re: I don't see why not. Go to [url]www.gnu.org[/url] and see if you can find the code there. | |
Re: [QUOTE=meaculpa;299079]Hi Need a cheap UK host please! Any help?[/QUOTE] [URL="http://forums.digitalpoint.com/"]Check here [/URL]in their Freebies forum. That site might have what you are looking for. | |
Re: You posted crappy unrealistic options. You can't learn Windows development without knowledge of either C or C++ (or some other computer language as well). So options B, D and E are impossible assuming you don't want to know about other languages. That leaves only options A and C as viable … | |
Re: 1) delete line 87 because its unnecessary. The function is prototyped in the header file. 2) line 108: time_after is never declared (see spelling on line 89) | |
Re: [QUOTE=jrahn50;745606]people should more aware about global warming...[/QUOTE] We are fully aware of it -- we just don't believe it. Global warming is a natural occurence that has occured many times in the earth's history. Al Gore is just a big joke. | |
[url]http://www.clickondetroit.com/video/10235271/index.html[/url] Now that's what I call productivity at the workplace :) | |
Re: Welcome to DaniWeb. For link exchange, [URL="http://www.daniweb.com/forums/forum158.html"]look here[/URL] | |
Re: Yes because the compiler can't optimize the code. It also makes the program at least twice the size it needs to be. | |
Re: Happiness -- over 65 and working because I want to not because I have to. | |
Re: If your husband can't control his urges then he needs professional counseling. Blocking access at home is only a bandaid not a cure. Only professional counseling can provide long-term solutions -- you need it too so that you know how to help him. I don't advocate "kick him out" until … | |
Re: I only have two e-mail accounts -- one at home and another at work. I rarly keep them beyond a couple days. Why keep all that junk that will never be read again? | |
Re: >> in >> attack; The line has already been read. So just convert the substr to an int similar to the previous string values [icode]attach = atoi(line.substr(weaponDamage.length()+1);[/icode] | |
Re: that book is a tad outdated replace <iostream.h> with this: [code] #include <iostream> using std::cout; [/code] | |
Re: Contract your nearest military installation and ask them. If you don't know who to contact then start with the Base Commander's office. You don't have to speak to the commander, but anyone on his staff should be able to point you in the right direction. | |
Re: Depends on the circumstances. Most of the time you will want loop counters to start at 0 because all arrays in C and C++ are 0 based, not 1 based. So the index number of the first element of any array is always 0. For consistency sake I always start … | |
Re: If you did your googling then you had to come across [URL="http://www.geocities.com/Jeff_Louie/safearray.html"]this article[/URL]. It illustrates an array of BSTRs, but the syntax is nearly the same for any POD (plain-old-data) type. | |
Re: >>any other ideas will still help Freaky's solution looks like a sure winner to me :) The only problem I see is if you unplug your computer before properly shutting down the program so the data can be saved. | |
Re: What has that got to do with the subject of your thread???? Did you try google? | |
Re: Don't know the answer to your question until I know the contents of the text file. Without that knowledge, generally I would use fgets() to read a line, then parse it into its individual parts into the structure. | |
Re: you have to add something before the return 0 to make the program stop. like this: [code] #include <iostream> using namespace std; int main () { cout << "Hello World! "; cout << "I'm a C++ program"; [color=red] cin.get(); [/color] return 0; } [/code] There are several other ways to … | |
Re: >>explicit BinaryHeap (int capacity = 0) [b]capacity[/b] a pretty useless variable! It goes out of scope and is destroyed immediately. | |
Re: you need to post code so we can see exactly what you are trying to do. | |
Re: >>for (i=0;i<=(this->Picture->Width/(3*this->cellsize));i++) >> for (ii=0;ii<=(this->Picture->Height/(4*this->cellsize));ii++) Don't you realize the program has to make all those calculations on every loop iteration? That's very very time consuming since the value of Width and cellsize do not change during those loops. It would be much more efficient to just calculate them once above/outside … | |
Re: From what I read this morning Ford doesn't want or need any bailout money at this time. It is either going to fix its own problems by itself, or wait until next month when Obama will be in charge. And Bush is going to nationalize the two remaining auto companies … | |
Re: copy the string one character at a time into another variable that is long enough to hold the extra characters. When an '' is encountered just copy two of them. But I have to question your reason for doing that. When you type a path from the keyboard into a … | |
Re: you can't open a file like that. fstream only works with files on your local computer. You have to use sockets to send the data to the server, then the server has to have a program that will receive the file across the socket and write it to the server … | |
Re: >>i have tried it but there is no change i got the same massage What error message -- you never said what that was. Post code and make sure main() is declared like ArkM posted. Post code if you need more help. And if you are trying to copy binary … | |
Re: It is $1.87/gallon here yesterday, down from high of about $4.20 or so earlier this summer. One station in St Louis is still selling at $3.80/gallon because he said he isn't going to lose over $5,000. | |
Re: We have an entire sticky thread devoted to books which you will probably want to read. |
The End.