Posts
 
Reputation
Joined
Last Seen
Ranked #1K
Strength to Increase Rep
+6
Strength to Decrease Rep
-1
72% Quality Score
Upvotes Received
3
Posts with Upvotes
2
Upvoting Members
3
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
3 Commented Posts
~31.9K People Reached
Favorite Tags
Member Avatar for sillyboy
Member Avatar for Kadence
Member Avatar for Dio1080
Member Avatar for avi_2009

lmgtfy strikes again! But seriously; we aren't your search engine jockies. Please try to refer to internet sources before coming to Daniweb; we can help you interpret, hell we can help you write, but we WON'T do what a child can do alone.

Member Avatar for mahatmagaga
0
171
Member Avatar for NordCoder
Member Avatar for SeeTheLite

So basically I'm making a generic class for rational numbers, and I want to do automatic type conversions in comparisons and operations and constructors. How would I go about doing this? Google has only returned results for template functions rational.h [code=c++] #ifndef RATIONAL_H #define RATIONAL_H class rational { public: rational(); …

Member Avatar for SeeTheLite
0
83
Member Avatar for group256

are you trying to do inheritance? If you are just declare your "nested" class with [code] class inner::public outter { [/code]

Member Avatar for Sky Diploma
0
142
Member Avatar for nova2177
Member Avatar for SeeTheLite

The google references were a bit varied and ambiguos and my textbook ironically doesn't cover templates ._. if I were to make [code=c++]template <typename typ> class stk { public: stk(); ~stk(); private: struct STK { typ dat; STK *lnk; }; *chn; int ctr; }; [/code] do I have to do …

Member Avatar for SeeTheLite
0
95
Member Avatar for hardikvd

[code] float a=3.145698; float b=a; [/code] define b as a; if you only want 3.14, just set the float precision to 2.

Member Avatar for mrnutty
0
87
Member Avatar for iamsmooth

Does your variable need to mark where new lines are? If not, you can just append each line to the same variable. If you do, just ad a null character(or a character of your choosing) after each line prior to appending.

Member Avatar for iamsmooth
0
93
Member Avatar for xfreebornx

factorial function: [code=c++] in factorial(int x) { int t; for(t = x; t >-;t++) x = x*t; return x; } [/code] I hope you read into function calling and creation.

Member Avatar for mrnutty
0
112
Member Avatar for jarrax

Your question is a bit unclear to me; but why do you need the type information? The best solution would be to grab the type prior to executing your script as lua uses dynamic typing anyways so it doesn't really matter if your arguments go in as a string, int, …

Member Avatar for Lerner
0
89
Member Avatar for SeeTheLite

If I delete a pointer, does it delete the data in the current address or all of it? example: [code] bool *dat; dat=new bool; dat=true; ++dat; dat=false; delete dat; --dat; [/code] if I printed dat, would it return true or just a random address?

Member Avatar for kvprajapati
0
93
Member Avatar for yasaswyg
Re: HELP

I found it easier to use a 52 unit bool array, using the index as the unique card ID and the value to determine whether it is in the deck or not. i.e. a[2] would be a 3 of spades, if it is true, it is still in the deck, …

Member Avatar for Hiroshe
0
179
Member Avatar for jake43

Oh good god, I don't even know where to begin: -why do you need a goto statement? a loop would do just fine -you are closing a nonexistent brackets -42 is not the random number you generated -and you also have improper brackets -don't forget srand(time(0)); anyways, a simplified code …

Member Avatar for SeeTheLite
0
97
Member Avatar for kz07

Do you need the original input? If not, you can just tolower()(or upper) the entire input, as it will do nothing if it is already lower(or uppercase).

Member Avatar for SeeTheLite
0
108
Member Avatar for spursfc

The nifty thing about ifstream is that it can open(and create) any type of file. That being said, you can have it prompt you for the file name and append .txt to the end or include .txt to the input. Just be sure to use a *char variable, as it …

Member Avatar for SeeTheLite
0
89
Member Avatar for SeeTheLite

Alright so I have a header file that includes another class with a pointer to a structure as a private variable. Does my second header have to be a pointer too or can it be static? [code=c++] #ifndef EXAMPLE1_H #define EXAMPLE1_H struct ex { int blah; char meh; }; class …

Member Avatar for Ancient Dragon
0
62
Member Avatar for Ancient Dragon
Member Avatar for eowyn0622

If you have ever played with legoes, you can build a machine; if you have a son, its kind of like a bonding experience(so mabe I'm exagerating) but neweggs IS having a sale, so you might want to consider it; besides, what can possibly go wrong?

Member Avatar for MosaicFuneral
0
167
Member Avatar for waldchr

Urgh, I skimmed your code and noticed the abscence of string arrays, have you considered using them? They make comparison so much easier. The are declared in this format: [code=c++] std:: string array[4]; [/code] dont forget to include <string> If you gave me the code snippet of where you think …

Member Avatar for waldchr
0
77
Member Avatar for TheFueley

Your function is a bit, no way too complicated >_>, just keep one pointer to track the first link of your list and reference it when you want to print it. [code=c++] Node *list, *front, *temp; list = new struct node; front = list //your code here, do not modify …

Member Avatar for TheFueley
0
181
Member Avatar for mhaviv
Member Avatar for moosoo

You shouldn't have to if you linked your compiler to them; if they came in that folder with your install, I wouldn't suggest moving them.

Member Avatar for SeeTheLite
0
67
Member Avatar for Carrots

[code=c++]struct list { //your structure Shape_data; Triangle_data; Square_data; list *link_front, *line_back } list *example; //initializing your pointer expample = new struct list; [/code] Not quite sure what you mean by including your class in a structure; honestly I would just make a class that inherits all three but the above …

Member Avatar for Intrade
0
124
Member Avatar for devfolarin

First, I'd like to say that although the effort is impressive, you are approaching this rather... crudely; there are a few things you can do to shorten your code(by A LOT). First of all, since your board is initialized to character '-', you can automatically assumed there will be nothing …

Member Avatar for SeeTheLite
0
84
Member Avatar for RoselineM

Right off the bat you can see that there are two problems that will cause you a massive pain. The first problem being you dont have an cout<<endl; anywhere, how are you going to get to the next line? secondly, if you look at the pattern, you can see that …

Member Avatar for DangerDuke
0
125
Member Avatar for phalgun_g

For the purposes of his project, the program wouldn't need to be nearly as comprehensive. That being said, some fun projects include: Random essay generator, graph constructor(make individual points, connect them, identify if they are a shape or on a single line ect, give information about shape(or line) i.e. perimeter, …

Member Avatar for MosaicFuneral
0
157
Member Avatar for Barefootsanders

I'm not familiar with servers but I if fork is anything like multithreading, it shouldn't affect the other process. As for the cin that doesn't bring your program to a halt, try the "GetAKeySyncState()" function from <windows.h>, but that only tracks key presses; if you play around with it you …

Member Avatar for Duoas
0
127