15,300 Posted Topics

Member Avatar for Dewey1040

MAX is not a function -- it is a macro. The macro says if a is greater than b then return a otherwise return b.

Member Avatar for Dewey1040
0
73
Member Avatar for KahneFan

[QUOTE=KahneFan;770094]Side question: Do you have to pay for mods, or are there some for free?[/QUOTE] We are all unpaid volunteers, which is one reason to have quite a few mods located all around the world for 24/7 coverage.

Member Avatar for Ancient Dragon
0
114
Member Avatar for jonathanasdf

If you have a standard C or C++ program you can use the [URL="http://www.cplusplus.com/reference/clibrary/cstdlib/atexit.html"]atexit() function[/URL]

Member Avatar for fskreuz
0
133
Member Avatar for ARYT

[QUOTE=ARYT;809317]It's Ok. I know the rules. [/QUOTE] Apparently not well enough to add code tags [noparse] [code=cplusplus] // your code here [/code][/noparse]

Member Avatar for r.stiltskin
0
286
Member Avatar for selvaganapathy
Member Avatar for crewxp

I'm not much on linux either, but I think you can combine all that into one statement: [icode]g++ vector_jar_test.cpp marble.cpp[/icode] will create the executable file a.out.

Member Avatar for crewxp
0
140
Member Avatar for rastaberry

lines 16, 17 and 18: too many loops and too many fgets() function calls. The while statement will read the entire file. Also you can use retazce like that because its just an array of pointers that point to nowhere. You have to first read the line into a valid …

Member Avatar for rastaberry
0
110
Member Avatar for Georges5

you should not have to modify that header file. Just add that header file to the *.cpp program's includes, call the functions, and tell the compiler what *.lib file to use. You could use a pragma to do that in the *.cpp file [icode]#pragma comment(lib, "mylib.lib");[/icode] or add it to …

Member Avatar for Ancient Dragon
0
136
Member Avatar for c_shaft05

The vector isn't expecting a pointer. Change the vector to this if you want pointers: [icode]vector<Shape*> shapes;[/icode]

Member Avatar for c_shaft05
0
122
Member Avatar for akn

static class members have to also be declared globally just like any other global object [code] // in the *.cpp file #include <iostream.h> #include <conio.h> #include "LineStorage.h" [color=red]LineStorage::vector <vector <vector<char> > > S;[/color] void LineStorage::setchar(int l,int w,int c,char d) { vector <char>::iterator it=LineStorage:: S[l][w].begin(); LineStorage:: S[l][w].insert((it+c-1),d); } [/code]

Member Avatar for Ancient Dragon
0
152
Member Avatar for FEARmike21

>>Is there a command in C++ that I could use to capitalize only the first letter and not the whole word? No. You have to do that yourself. The toupper() function works on only one character. Instead of all those gets(), you would just get input from the keyboard in …

Member Avatar for siddhant3s
0
152
Member Avatar for lil_panda

there is no such thing as an "obj-c" class. C language knows nothing about classes. Maybe you mean a structure object declared in a c translation unit (*.c program) ? [code] // *.cpp file extern C int myint; [/code] if you have a large group of objects [code] // *.cpp …

Member Avatar for ArkM
0
169
Member Avatar for Ancient Dragon

I came across this utube video while doing my modly duties on PFO. What an ingenious device that lets one man do the work of a hundred men. [url]http://www.youtube.com/watch?v=g658QgjFYt0&eurl=http://www.containerlift.ru/&feature=player_embedded[/url]

Member Avatar for jbennet
0
131
Member Avatar for rickster11

For some reason ifstream doesn't work with that file. Change it to FILE pointer and it works ok [code] // ifstream inPresFile("presfile.dat"); FILE* inPresFile = fopen("presfile.dat", "rb"); // <<< THIS if (!inPresFile) { cout<<"File could not be opened"<<endl; exit(1); } heading(); int counter = 0; //for (int counter=1; counter < …

Member Avatar for rickster11
0
146
Member Avatar for shamila08

line 50 and 51: array numbers always begin with 0, not 1. [code] for(int i = 0; i < n; i++) { for(int j = 0; j < n; j++) { num[i][j] = j+1; } } [/code] line 44: >>matrixPermute (temp); This is a recursive function call, yet you always …

Member Avatar for shamila08
0
144
Member Avatar for Yersey

If the string looks something like this: [icode]Dani Web 100[/icode] Then just use getline() to read the entire line, and start at the end of the string and back up until you find the first space, split the string at that point.

Member Avatar for Ancient Dragon
0
169
Member Avatar for dvsConcept

how to do that will depend on the compiler, each one is a little different. Do you mean you want to put the source files, such as *.cpp, *.c, and *.h, in different folders?

Member Avatar for dvsConcept
0
102
Member Avatar for StainlessSteelR

>>my biggest problem at the moment is how do I pass the pointer into the function when the pointer is pointing to a struct? Do it the same as you would do with any other data object, such as a pointer to an int [code] void foo( Divison* pDiv) { …

Member Avatar for Ancient Dragon
0
122
Member Avatar for karen_gfw

Welcome to DaniWeb. There are quite a few of us older people here now. Welcome to the gang :)

Member Avatar for jbennet
0
86
Member Avatar for Argo54325

line 10: that function gets the file size the hard and slooooow way. All you have to do is seek to the end of file then call tellg() to get the file size -- only two lines of code :) If you want to leave that function as it is, …

Member Avatar for nucleon
0
186
Member Avatar for GadiK

pass it as a parameter to DrawingARect() and to the drawing functions in your class.

Member Avatar for Ancient Dragon
0
201
Member Avatar for odzky

[QUOTE=odzky;809747]Create a function w/c accepts as input the double numbers x1,x2,x3 and returns to the program the value of the average (x1+x2+x3)/3 as a variable parameter. #include<stdio.h> #include<conio.h> main() { [/QUOTE] stdio.h and conio.h are both C header files, not c++. you posted this in the c++ forum -- is …

Member Avatar for Ancient Dragon
0
278
Member Avatar for dise652
Member Avatar for ahihihi...
-1
118
Member Avatar for ghostworkers

[QUOTE=niek_e;795835]Yes there is. He's called [URL="http://www.daniweb.com/forums/member46588.html"]Ancient Dragon[/URL] and is moderator right here at Daniweb :)[/QUOTE] Thanks Nick, I'll remember that next time :) [quote][URL="http://en.wikipedia.org/wiki/Geek"]This word comes from English dialect geek, geck: fool, freak; from Low German geck, from Middle Low German. The root geck still survives in Dutch gek: crazy, …

Member Avatar for sneekula
0
137
Member Avatar for Lamar Cole

[QUOTE=Lardmeister;805810]Doesn't this short poem about love just melt your heart? Note: Sorry AD about the dragon slaying stuff, it's not my poem.[/QUOTE] No offense taken -- I was slain a lot of times in my D&D games :)

Member Avatar for sneekula
0
171
Member Avatar for jamescolin
Member Avatar for jbennet
0
342
Member Avatar for William Hemsworth
Member Avatar for dcawley

you can't do xor operation on an entire array -- only one element at a time. [icode]msg[0] ^= generator;[/icode]

Member Avatar for Nick Evan
0
190
Member Avatar for LCR

>>else if(currentChar == "" ) cout << " " << endl; change that "" to " " (with a space between the quotes) [code] else if(currentChar == "" ) cout << " " << endl; else if(currentChar == ",") cout << "," << endl; else if(currentChar == ".") cout << …

Member Avatar for LCR
0
78
Member Avatar for Clockowl

>>Why is element not declared? Because you have recursive includes -- each header file includes the other. In eventhandler.h try this: [code] #ifndef EVENTHANDLERH #define EVENTHANDLERH [color=red]class element; [/color] // forward declaration of class enum events {onClick, onHover}; typedef struct eventHandlerT { void(*func)(element *elem); events eventType; } eventHandler; #endif // …

Member Avatar for Clockowl
0
101
Member Avatar for waldchr

open the file read each line for each line read, search the line for the given word. If you ust std::string to hold the line then use it's find() method. You will probably first have to convert the line to all lower or upper case so that you get case-insensitive …

Member Avatar for waldchr
0
99
Member Avatar for marconi0708

Once in what time-span? Such as once an hour? once a day? I would probably store the current date/time in the ini file, then on program startup read that information and act according to how often the program should run. such as if its not time to synchronize the clocks …

Member Avatar for Ancient Dragon
0
68
Member Avatar for Ziwx

>>[color=red]pers[i].haemta_betalat() [/color]= pers[i].haemta_betalat() + pny.haemta_betalat(); haemta_betalat() is a function call, you can not add anything to its return value. What you want is this: [icode]pers[i].betalat_andras = pers[i].betalat_andras + pny.haemta_betalat(); [/icode] But that might give you an error too since betalat_andras is a private member of the class. You could fix …

Member Avatar for Ziwx
0
116
Member Avatar for jrw0267

getline() will read the entire line [code] std::string line; std::ifstream in("filename.txt"); while( getline(in, line) ) { cout << line << "\n"; } [/code]

Member Avatar for idb_study
0
75
Member Avatar for kiddo.me

>>What memory model does Dev-Cpp follow...? Flat memory model, the same as all other 32-bit compilers. >>And how can I change it to have a segment more than 64 KB of memory You don't have to change it. You can write a program of about 2 gig in size if …

Member Avatar for kiddo.me
0
128
Member Avatar for pedza95

The implementation of cin and cout is compiler/os dependent. On MS-Windows I suspect Microsoft implemented it by using win32 api console functions. And, as others have said, this is very advanced programming. [URL="http://www.codeproject.com/KB/winsdk/JLib.aspx"]Here [/URL]is some source code if you are up to the task. You will find more information [URL="http://letmegooglethatforyou.com/?q=windows+console+functions"]here.[/URL]

Member Avatar for MosaicFuneral
0
1K
Member Avatar for C.G.P.

[QUOTE=C.G.P.;802482]CSCGAL. I just joined the DaniWeb Community and noticed that I can't even view my profile. It's odd, I can't even figure out how to view my own profile.[/quote] Click the CONTROL PANEL link at the very top of the page. You can access your profile from that dropdown menu. …

Member Avatar for jbennet
0
175
Member Avatar for ganbree

The "thing" at the start is probably a binary character that tells programs the file is UNICODE format -- its called "[URL="http://www.helpware.net/FAR/help/Unicode2.htm"]UNICODE signature[/URL]". When you click [URL="http://www.helpware.net/FAR/help/Unicode2.htm"]this link [/URL] scroll down the page until you find the section titled "unicode signature". Please feel free to read the rest of the …

Member Avatar for seanhunt
0
585
Member Avatar for M3rcury

M3rcury: the code you original posted is worthless to us. Post the new code (all of it) that you are actually using and which is giving you problems. And thanks for using code tags correctly, not many new posters bother to do that :) :)

Member Avatar for Ancient Dragon
1
110
Member Avatar for tantalus

Welcome to DaniWeb where you will find several of us old folks here and even a couple teachers.

Member Avatar for jbennet
0
86
Member Avatar for bussaina

Read the list of format specifiers for [URL="http://www.cplusplus.com/reference/clibrary/cstdio/printf.html"]printf() function[/URL]. You will see that %d is decimal, %o is octal and %x is hex. With that information you should be able to write your program in just a few lines of code -- one line of code for the actual print …

Member Avatar for Ancient Dragon
0
307
Member Avatar for Rashakil Fol

[QUOTE=Rashakil Fol;805193] This unacceptable, and I demand that this be fixed! How can I give information when these unkempt forum icons are profaning the digital landscape with their pixels of evil on every other page I visit? Dictated but not read, Rashakil Fol[/QUOTE] If you are trying to be funny …

Member Avatar for jbennet
1
130
Member Avatar for nishidh

>>When I try to compile this Makefile I get errors like boostnb.o is missing. Well, did you check the file system to see if it is missing? If it is then it didn't compile correctly or you failed to add it to the makefile, and you should have received error …

Member Avatar for daviddoria
0
163
Member Avatar for maui_mallard

I have had XP Pro for some time and just today installed Vista Home Premium. It would not allow me to upgrade XP Pro because it said I would need the Business or better version. So it did a fresh install on a second drive d: in my computer and …

Member Avatar for Henry Schubel
0
243
Member Avatar for babu02021964

There are some legitimate reasons to do such a thing. I've done something similar before so that I could keep the two files together without resorting to writing an installation program. I think there are at least two choices: 1) compile it as a resource in the resource file. 2) …

Member Avatar for Salem
0
123
Member Avatar for scru

It might be your computer, your window resolution setting, or your operating system. install another font perhaps? search [url]www.codeproject.com[/url] or some other similar sites for example code.

Member Avatar for WolfPack
0
127
Member Avatar for spo-apt
Member Avatar for Ancient Dragon
0
293
Member Avatar for massivefermion

There are literally thousands of win32 api functions, and more are added with each new version of MS-Windows. You will not find all of them in any one place, except possibly MSDN at [url]www.microsoft.com[/url]

Member Avatar for death_oclock
0
107
Member Avatar for keyser soze

I found [URL="http://www.autoitscript.com/forum/index.php?showtopic=70853"]this with google [/URL]-- and you could have too. But I don't know if it answers your question.

Member Avatar for ArkM
0
121
Member Avatar for uhguy77017

all your program is doing is parsing the filename (see line 11). What you need to do is read a line from the file then call strtok() on the input buffer for that line, such as [code] char line[255]; while( fgets(line, sizeof(line), file) { ptr = strtok(line, ","); // assume …

Member Avatar for ArkM
0
186

The End.