15,300 Posted Topics

Member Avatar for osan

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 …

Member Avatar for Ancient Dragon
0
281
Member Avatar for integer*09

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.

Member Avatar for integer*09
0
2K
Member Avatar for smithss

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]

Member Avatar for smithss
0
139
Member Avatar for robotnixon

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 …

Member Avatar for Ancient Dragon
0
92
Member Avatar for a10m84

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 …

Member Avatar for Salem
0
145
Member Avatar for d0ne

[URL="http://letmegooglethatforyou.com/?q=c+calendar+program"]Here you go[/URL]

Member Avatar for Sky Diploma
0
88
Member Avatar for daviddoria

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.

Member Avatar for daviddoria
0
100
Member Avatar for ribena500

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

Member Avatar for Ancient Dragon
0
79
Member Avatar for deathevan

[URL="http://www.codeproject.com/KB/tree/shelltreectrl.aspx"]Here is a start.[/URL]

Member Avatar for Ancient Dragon
0
70
Member Avatar for Aia

could Sanjay Gupta be any worse than Joycelyn Elders, who was fired by Bill Clinton

Member Avatar for GrimJack
0
183
Member Avatar for altrim

what is wrong with it? line 37: geta() is a function -- you need to add the ()

Member Avatar for Ancient Dragon
0
116
Member Avatar for cppnewb

[URL="http://letmegooglethatforyou.com/?q=change+font+in+windows+console"]Read this[/URL]

Member Avatar for Ancient Dragon
0
110
Member Avatar for TasostGreat

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 …

Member Avatar for TasostGreat
0
1K
Member Avatar for umen
Member Avatar for umen
0
86
Member Avatar for massivefermion

You can use[URL="http://www.codeblocks.org/"] Code::Blocks compiler[/URL], which is more up-to-date than Dev-C++.

Member Avatar for VernonDozier
0
400
Member Avatar for Mahsa_C++

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

Member Avatar for Ancient Dragon
0
142
Member Avatar for smithss

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.

Member Avatar for smithss
0
115
Member Avatar for bobolabobo

[QUOTE=peter_budo;777200]Question: Who is not looking for good job in these times of depression?[/QUOTE] Not me :)

Member Avatar for jbennet
0
19
Member Avatar for kanaku

This has been reported before, but I can't find the thread at the moment. As I recall (maybe wrongly) that comment is intentional.

Member Avatar for jbennet
0
104
Member Avatar for sirihoney
Member Avatar for Salem
0
50
Member Avatar for moyon_x

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

Member Avatar for Ancient Dragon
0
300
Member Avatar for cppnewb

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 …

Member Avatar for Rashakil Fol
0
111
Member Avatar for shamila08

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)

Member Avatar for shamila08
0
153
Member Avatar for Salem
Member Avatar for John A
0
179
Member Avatar for kimax

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

Member Avatar for sneekula
0
179
Member Avatar for Ancient Dragon

[url]http://www.clickondetroit.com/video/10235271/index.html[/url] Now that's what I call productivity at the workplace :)

Member Avatar for GrimJack
0
206
Member Avatar for mycomfyhome

Welcome to DaniWeb. For link exchange, [URL="http://www.daniweb.com/forums/forum158.html"]look here[/URL]

Member Avatar for mycomfyhome
0
57
Member Avatar for monkey_king

Yes because the compiler can't optimize the code. It also makes the program at least twice the size it needs to be.

Member Avatar for daviddoria
0
89
Member Avatar for Ene Uran

Happiness -- over 65 and working because I want to not because I have to.

Member Avatar for vegaseat
0
160
Member Avatar for notverygeeky

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 …

Member Avatar for cohen
0
145
Member Avatar for roryt

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?

Member Avatar for roryt
0
264
Member Avatar for Gekitatsu

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

Member Avatar for Yiuca
0
177
Member Avatar for learning_prog

that book is a tad outdated replace <iostream.h> with this: [code] #include <iostream> using std::cout; [/code]

Member Avatar for John A
0
129
Member Avatar for hpatch
Member Avatar for Mike.Rigsby

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.

Member Avatar for Ancient Dragon
0
100
Member Avatar for uxp

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 …

Member Avatar for uxp
0
141
Member Avatar for komofilms

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.

Member Avatar for Ancient Dragon
0
94
Member Avatar for azwraith69

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

Member Avatar for azwraith69
0
141
Member Avatar for nm_9218

What has that got to do with the subject of your thread???? Did you try google?

Member Avatar for Salem
0
95
Member Avatar for benchCUB

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.

Member Avatar for Ancient Dragon
0
129
Member Avatar for DonkeyKong92

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 …

Member Avatar for Kungpao
0
176
Member Avatar for abhishek2301

>>explicit BinaryHeap (int capacity = 0) [b]capacity[/b] a pretty useless variable! It goes out of scope and is destroyed immediately.

Member Avatar for Murtan
0
280
Member Avatar for mini programmer
Member Avatar for mini programmer
0
130
Member Avatar for heimdhal

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

Member Avatar for ArkM
0
159
Member Avatar for Salem

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 …

Member Avatar for GrimJack
0
318
Member Avatar for CoolAtt

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 …

Member Avatar for CoolAtt
0
160
Member Avatar for Phil++

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 …

Member Avatar for Phil++
0
61
Member Avatar for nitu_thakkar

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

Member Avatar for Ancient Dragon
-1
136
Member Avatar for vmanes

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.

Member Avatar for Dave Sinkula
0
248
Member Avatar for Bladtman242
Member Avatar for Bladtman242
0
164

The End.