15,300 Posted Topics

Member Avatar for magicor

[URL="http://www.daniweb.com/code/snippet579.html"]Here is a c++ example[/URL]. If all you want to do is display the files then you can easily convert it to C by just removing all the vector stuff and printing the filenames instead of storing them in a list of any kind.

Member Avatar for Ancient Dragon
0
75
Member Avatar for seakayaker

class variables do not have to be passed as parameters to class methods because the methods already have full access to them. Post an example of why you think you need global variables.

Member Avatar for seakayaker
0
166
Member Avatar for Ancient Dragon

I just finished installing Fedora 11 on my 64-bit Vista computer (dual boot) and see that it does not include gcc or g++. I looked on gnu.org, found something that described the gcc compiler package (briefly) but no links to where to download the binaries. Anyone have links to it?

Member Avatar for Nick Evan
0
259
Member Avatar for daveyb91

[QUOTE=MosaicFuneral;959097]You still get the auto-send message, even if you report your own self. Hitting the submit button a couple times, in the lag, isn't something to cry over.[/QUOTE] Yes you will get an auto-send message about the mod deleting the thread, but you probably won't get the warning, unless the …

Member Avatar for The Dude
0
179
Member Avatar for goody11

what compiler? what os? what kind of directives ? Do you mean pragmas or preprocessor directives or something else?

Member Avatar for Salem
0
141
Member Avatar for PopeJareth

>>Is it possible to compile a single .cpp (not a project) in visual studio 2008 No. >>Also will using visual studio cause problems executing code on a unix system? If you mean run the *.exe on *linux, the answer is that it cannot. You will have to compiler it on …

Member Avatar for William Hemsworth
0
205
Member Avatar for darkagn

I have never received that PM before either. And I ignored it because most of the questions do not apply to me and there were no appropriate answers for someone like me. I started to fill it out, but quit when I got to the part that asked for personal …

Member Avatar for Chaky
0
174
Member Avatar for maudits

Is the only reason you are using MFC is to get CString class? If yes then why don't you dump MFC and use <string> instead? The only advantage that CString has over <string> is its Format() method, which is more like sprintf(). [quote]opic since 98 to 2009 CString is extict …

Member Avatar for rajshreedugar
0
517
Member Avatar for vivekarora

[QUOTE=DdoubleD;962196]This is news to me, but it has been a while since I used CPP and maybe it has evolved. My understanding is that any class that implements a "pure" virtual function is an abstract class that forces you to define the function or it also becomes an abstract class. …

Member Avatar for vivekarora
0
188
Member Avatar for crys0011

[QUOTE=crys0011;488040]Do u have any more idea about the advatages of using cin and cout compared to printf() and scanf()?[/QUOTE] Personally I think the c++ implementation of cout is absolutely horrible. In its simplest for cout is pretty easy to use, but get really complicated when you want nicely formatted code …

Member Avatar for mrnutty
0
127
Member Avatar for scantraXx-

It probably doesn't work the second (and subsequent) time around because the file isn't closed, so it can not be reopened. And why would you want to read that file over and over and over .. and over every time you select option #1??? Just read it upon program start …

Member Avatar for tux4life
0
195
Member Avatar for basketball4567

1. USE CODE TAGS! 2. Move the open statement up outside the loop. [code] void dptable(int upplimit) { ifstream("favlist.txt"); for(int i=0; i<upplimit; i++) { cout<<fs[i].id<<" "<<fs[i].url<<" "<<fs[i].annotation<<endl; } } [/code] 3. Delete that ofstream object that you put in main() -- it serves no purpose and may cause problems with …

Member Avatar for Ancient Dragon
0
493
Member Avatar for seakayaker

my guess is that the filename is passed to your program as an argument to WinMain(), much like argv in main().

Member Avatar for Ancient Dragon
0
94
Member Avatar for Dsiembab

[QUOTE=cwarn23;958625]If your trying to read the c++ manual then where is the c++ manual or is cplusplus.com it.[/QUOTE] There really is no one physical manual any more, to RTFM is sort of an archaic term. 20 years ago Microsoft used to ship all the manuals with their compiler. But they …

Member Avatar for GrimJack
0
199
Member Avatar for mameth

you may have to write the drawing code yourself, but QT is a GUI library that is portable between MS-Windows a *nix. There a few others too, I think wxWidgets is one of them.

Member Avatar for mameth
0
119
Member Avatar for AssaultM16

1. pass the variable as a parameter to the function. 2. you mean something like this? [code] void foo(int x) { cout << "x = " << x << "\n"; } int main() { int n = 123; foo(n); } [/code]

Member Avatar for mrnutty
0
99
Member Avatar for katwalatapan

two problems: 1) You have to prototype that function -- meaning you have to declare it before using it. Add this somewhere above function main() [icode]char *long2hex(long c)[/icode] 2) line 11 is incorrect: it should be this:[icode]b[0]=long2hex(a);[/icode] But why did you declar b as an arry of 5 character pointers …

Member Avatar for katwalatapan
0
137
Member Avatar for vivekarora

No -- derived class has not been constructed at that point. When an object is instantiated the compiler first calls the base class then all derived classes, working its way up from the bottom to the top of the hierarchy. classes are destroy in the opposite manner.

Member Avatar for vivekarora
0
176
Member Avatar for ewanko
Re: C++

look it up in your textbook ??? Also, read [URL="http://www.experts-exchange.com/Programming/Languages/CPP/Q_11622238.html"]this thread[/URL] to get the definition of an "implicit argument".

Member Avatar for kvprajapati
0
73
Member Avatar for xfreebornx
Member Avatar for AutoC

As far as I can tell [b]farmalloc()[/b] is only implemented on 16-bit compilers. There is no such thing as a "far heap" in 32 (or more)-bit programs because they use the flat memory model where all memory is considered near.

Member Avatar for Salem
0
166
Member Avatar for kaninelupus

Another reason for soft deletes is so that the mod (or SuperMod, or other Admin) can reverse the decision to delete the thread. If it were a hard delete then there it can not be undeleted. Mods are human too and sometimes make the wrong decisions.

Member Avatar for kaninelupus
-1
470
Member Avatar for Kakooty
Member Avatar for acidleaf

>>writer.write(reinterpret_cast<char*>(this) The class can not be written that simply because it contains std::string and pointers. That makes the serialization algorithms much more complex and makes the file a variable length records, almost like any ordinary text file. If you have to use binary format, I would suggest you use character …

Member Avatar for acidleaf
0
216
Member Avatar for jp071

First you have to know what kind of data is arriving at the port. Then just add the characters to a data buffer. I have no idea what data you are getting, so just assume you want to put it into a character array [code] unsigned char buffer[255] = {0}; …

Member Avatar for Nick Evan
0
333
Member Avatar for xfreebornx

help you fix what??? The most obvious problem is that it is using uninitialized variables a, b and c. Next, function [b]average[/b] only takes one argument, not 3. Either change that function to accept three arguments or only pass one. [edit]^^^ what Tom said. [/edit]

Member Avatar for thug line
0
94
Member Avatar for kaustubha.s

just change the filename. Otherwise how to do that will depend on the compiler. Some compilers have option flags to do that and others don't.

Member Avatar for Salem
0
83
Member Avatar for MattEvans

15. never plan/design a new program, just start typing and see where it will take you. 16. write programs in assembly language. higher-level languages are for wimps.

Member Avatar for ithelp
0
498
Member Avatar for VBNick

A double click is nothing more than two clicks in rapid succession. Your program will get two click events, not one. [edit]Never say never! If you are using Windows hooks then you might want to read [URL="http://www.codeproject.com/KB/cs/globalhook.aspx?msg=852443#xx852443xx"]this article[/URL], especially one of the comments at the end of the article.

Member Avatar for VBNick
0
2K
Member Avatar for codester

Windows batch files isn't sophisticated enough to do all that. You will need to write a small program in one of the man programming languages such as C or C++. Is this the output you want? [quote] AAAUSA-0046,AAAA,AAAAA061,100.00 AAAUSA-0057,AAAA CCCC -,AAAAA026,100.00 Press any key to continue . . . [/quote]

Member Avatar for codester
0
201
Member Avatar for Nogat21

>>if(_stricmp(value,gen_arr[i])== 0){ gen_arr a single character array? or is it an array of strings? If its a single character array then do this (without indexing) [icode]if(_stricmp(value,gen_arr])== 0){[/icode]

Member Avatar for Nogat21
0
110
Member Avatar for rminela
Member Avatar for moggy1967
0
34
Member Avatar for missty

open the file, seek to end, get position, then finally check if position is 0. [code] ifstream in("myfile.txt"); in.seekp(0, ios::end); int spot = in.tellg(); if( spot == 0) { cout << "Empty file\n"; } [/code]

Member Avatar for Dave Sinkula
0
3K
Member Avatar for gretty

Easy implementation. It becomes a little more complicated when you want to also use '*'. Much more complex implementations can be found in boost regex library (regular expression library). [code] bool wordPattern(string pattern, string word) { if( pattern.length() != word.length()) return false; for(int i = 0; i < word.size(); i++) …

Member Avatar for gretty
0
148
Member Avatar for Nathan Campos

There isn't a forum for it because no one has ever asked a question about it and the likelyhood that Dani will create another forum for it is very very remote. Post such a question in "Legacy and Other Languages" forum.

Member Avatar for happygeek
0
148
Member Avatar for jp071

Just try to open it -- if open files then its probably already opened (assuming COM1 exists and there are no hardware problems)

Member Avatar for Salem
0
227
Member Avatar for raul14

[quote]4. String formatting using <iomanip.h> header file[/quote] OMG :icon_eek: You mean to tell us that you school is teaching you the wrong stuff! iomanip.h has been deprecated (obsolete) for almove 10 years now. The current file name is <iomanip> (no .h extension). I wonder what else they have been trying …

Member Avatar for Salem
0
145
Member Avatar for abhishek4563

1) yes, but beware of stack overflow if the array is too large. 2) probably, but some operating systems may not deallocate it. 3) I don't know.

Member Avatar for abhishek4563
0
89
Member Avatar for __vmware__

you have not written the implementation code for the functions in those two classes.

Member Avatar for __vmware__
0
98
Member Avatar for serkOner

The 'C' just means C-language. >>Is that a common practice in software development? No. Microsoft coders like to use such prefixes in their classes/structures, but not in filenames.

Member Avatar for serkOner
0
126
Member Avatar for rakesh_01

What exactly is an "interactive menu"? One that talks back to you? And "interacts with you" ? A menu that shocks the keyboard if you do something wrong?

Member Avatar for Ancient Dragon
0
362
Member Avatar for nicholasamh

[URL="http://msdn.microsoft.com/en-us/library/aa363194%28VS.85%29.aspx"]This is what you are looking for[/URL]

Member Avatar for syen81
0
142
Member Avatar for vonriechen

Just how big is your bank account anyway? Did you take your own silly advice?

Member Avatar for Wasser
-2
35
Member Avatar for Ancient Dragon

Today my wife and I have been married (to each other :)) for 47 years. Going to wine and dine this evening so you won't see me around for the rest of today.

Member Avatar for Wasser
1
232
Member Avatar for cfrctsc

There's Open Source, freeware and public domain. Almost everyone uses free software of one sort or the other. FireFox is just one of many. And there are a lot of free compilers and editors. Would I use them? Of course I would (and do). :) But what does this have …

Member Avatar for crunchie
0
77
Member Avatar for poliet

must be something else wrong because this compiles ok with vc++ 2008 Express [code] class A { public: void* ptr; A() {ptr = 0;} }; int main() { A* a = new A; int* p = static_cast<int*>(a->ptr); *p = 1; } [/code] This one also has no problems [code] class …

Member Avatar for poliet
0
220
Member Avatar for Eric_

you have to link with the appropriate DirectX libraries. When you downloaded the DirectX SDK you also got a lot of sample programs. Look in them and they will tell you what libraries you need. Or you can just read MSDN to find that out.

Member Avatar for Eric_
0
183
Member Avatar for goody11

Are you using MFC or win32 api functions? When you created the edit box you got a HANDLE to the object. See [URL="http://msdn.microsoft.com/en-us/library/bb761661%28VS.85%29.aspx"]this article[/URL]

Member Avatar for goody11
0
156
Member Avatar for Nogat21

line 6: >> fstream file(nome, ios::in || ios::out || ios::binary); You are using the boolean || operator, not the bitwise | operator

Member Avatar for Nogat21
0
89
Member Avatar for akmalcrazy

The End.