1,358 Posted Topics

Member Avatar for thriek

[QUOTE=thriek;1189581]ok I'm confused... my class is empty, apart from an inclusion file, but has alot of errors that i cant understand.... Here's the .h file: [CODE] #ifndef creator #define creator #include "stdafx.h" class creator { public: creator(); ~creator(); } //<------------ syntax error: a semi-colon is required here. #endif [/CODE] <snip> …

Member Avatar for Nick Evan
0
12K
Member Avatar for Valmir2398

[URL="http://www.daniweb.com/forums/announcement8-2.html"]What have you done so far? We're not going to do your final project for you.[/URL]

Member Avatar for Fbody
0
43
Member Avatar for fantum

I'm not real sure what your question is. Are you trying to separate the names as you input them? Separating them is the easy part. The hard part is managing the data after the input. I think you could do something with nested loops and a vector of strings. Keeping …

Member Avatar for Fbody
0
137
Member Avatar for jeffrey o

That is what the issue is. Multiple #includes on standard headers aren't a problem, its the the multiple #includes on the custom "vehicle" headers that is the problem. The OP either needs to add header guards or change their inclusion structure to eliminate the redundancies.

Member Avatar for Fbody
0
145
Member Avatar for LostnC

Inheritance could also be referred to as "specialization" or an "x [B]is a[/B] y" relationship. For example, a Cat is a "specialized" type of Mammal: What are some things that define a Mammal? Two common ones are "isHairy" and "isWarmBlooded", among others. What are some things that define a Cat? …

Member Avatar for mrnutty
0
206
Member Avatar for teomurgi

You might need to use a dynamic allocation which would then require delete[]. I don't think the compiler will let you do that the way you have because I don't think [iCODE]strlen(msg)[/iCODE] is technically considered a constant. It looks like you want to copy the message before sending it to …

Member Avatar for vmanes
0
342
Member Avatar for philipB

What is the "something weird"? What you have posted won't compile because you didn't provide the "logic.h" header file... I suspect it's something like: n a m e 1 0 a v g e g r e y n n a m e 2 0 d h i n f …

Member Avatar for WaltP
0
230
Member Avatar for summey

Based on what I see, you won't want a const. Are you familiar with the terms "arguments" and "parameters"?

Member Avatar for summey
0
351
Member Avatar for PTRMAN1

Where and how you initialize them depends on the structure of the program. How much of that structure did the prof give you, and what changes did you make? It may be easiest if you post the given structure as a reference. That would allow us to see your changes …

Member Avatar for PTRMAN1
0
103
Member Avatar for inisca

[QUOTE=jwenting;1188053]Those are pretty clear compiler errors. I'd suggest you try to resolve them, and ask specific questions about them if you can't figure out how to go about that.[/QUOTE] I agree.... @OP: [URL="http://www.gidnetwork.com/b-38.html"]I suggest you re-evaluate your formatting and work on readability.[/URL] It appears that you are not matching up …

Member Avatar for Fbody
0
191
Member Avatar for Tellalca

Considering your filenames, you are probably compiling as C instead of C++. C does not support classes, only C++ does. You will need to change your source filenames from (*.c) to (*.cpp). Also, try changing your class name and file name to something else such as "myStack" or "manualStack". Once …

Member Avatar for Tellalca
0
226
Member Avatar for K0ns3rv

What compiler are you using and what is the specific error that you are getting?

Member Avatar for kay25
0
163
Member Avatar for mrbright88

How do you start every C++ program? You should know how the various loops, relational, and logical operators work by now. Figure it out... [URL="http://www.daniweb.com/forums/announcement8-2.html"]Unless you don't know anything because you've been sliding by...[/URL]

Member Avatar for CppBuilder2006
-2
88
Member Avatar for einas

Nice first post... :yawn: [URL="http://www.daniweb.com/forums/announcement8-2.html"]Welcome, and good Luck with that.[/URL] (I suggest you read the link.)

Member Avatar for einas
0
164
Member Avatar for Lukezzz

I'm not familiar enough with .NET to know the exact operator(s) you need, but as I understand things, "String^ line" is a pointer to a string, it is not an actual string. Try to de-reference the pointer when you do your comparison. That's just my 2-cents. Take it how you …

Member Avatar for Lukezzz
0
109
Member Avatar for 3cats

[QUOTE=3cats;1177824][CODE]{ if (AcctType == 'c' && CurrentBal < MinBal) CurrentBal -= CHK_SERV_CHRG;[/CODE][/QUOTE] The structure of your if statement itself is not correct. As a result, the else is not associating with it properly (it's a technical thing, I won't confuse you with it). The opening brace should be after the …

Member Avatar for 3cats
0
170
Member Avatar for cwarn23

Wasn't sure if this was relevant here or if I should start a new thread... Is there a new thread restriction for new members that I'm not aware of? [URL="http://www.daniweb.com/forums/post1176071.html#post1176071"]This post is a hijack attempt[/URL]. The user claims the forum won't let him start a thread... I told him how …

Member Avatar for WaltP
0
355
Member Avatar for mommie

I'm guessing you're talking about the while on line 29? As you have written it, you are attempting to compare the values stored in the variables named [I]response[/I] and [I]no[/I]. The problem is that the variable [I]no[/I] does not exist. Based on what I see, you should consider re-writing the …

Member Avatar for WaltP
0
95
Member Avatar for skorm909

[QUOTE=LevyDee;1182353]Yes, except your loop parameters are going to be != instead of /=. /= is not a valid operand. And your pipes are going to be || instead of |.[/QUOTE] Actually, '/=' is a valid operand. The statement "[ICODE]x /= y;[/ICODE]" is shorthand for dividing x by y then saving …

Member Avatar for Fbody
0
158
Member Avatar for knight_268

[Bubble Sort](http://www.sorting-algorithms.com/bubble-sort) is a very simple algorithm. What seems to be the issue? What kind of [research](http://www.lmgtfy.com/?q=Bubble+Sort) have you done? Other than building a program shell, [what have you done](http://www.daniweb.com/forums/announcement8-2.html) so far? Oh, and [use code tags](http://www.daniweb.com/forums/announcement8-3.html)...

Member Avatar for Fbody
0
98
Member Avatar for Juicy5ursoul

My eyes are bleeding. I can't comprehend this wall of text. I think you want us to do your homework for you ([URL="http://www.daniweb.com/forums/announcement8-2.html"]which won't happen[/URL]), but I can't tell.....

Member Avatar for Juicy5ursoul
0
143
Member Avatar for virgin199

Other than the fact that your first example didn't use classes at all, you did fine. An example class: [CODE] //class.h file //an example class class exampleClass { private: int memberInt; protected: public: exampleClass() : memberInt(0) {} //default constructor exampleClass(int newMemInt) : memberInt(newMemInt) {} //specified constructor ~exampleClass() {} //destructor void …

Member Avatar for jephthah
-2
670
Member Avatar for roin14

[QUOTE=Robert1995;1176813]if you're planning to do it with switch it will be a pain [CODE]#include <iostream> using namespace std; int main () { int i; cout<<"Sigh ";cin>>i;cout<<endl<<"Answer : "; if(i>=70 && i<=100)cout<<"A"; if(i>=60 && i<=69)cout<<"B"; if(i>=50 && i<=59)cout<<"C"; if(i>=40 && i<=49)cout<<"D"; if(i>=0 && i<=39)cout<<"F"; if(i<0 || i>100)cout<<"Not Good"; }[/CODE][/QUOTE] [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]I suggest …

Member Avatar for Robert1995
0
117
Member Avatar for ischuldt

I don't like it either way, because I can't read it. Code tags are used [CODE] ... your code here ... [/CODE]. Or, you can just click the CODE button in the posting toolbar. I suggest you edit your post within the next 15-minutes to correct the tags. [edit] ACK!! …

Member Avatar for Fbody
0
136
Member Avatar for allaboutdrew

Looks like you could do it with another if and a counter variable. Just make sure that the second if is also part of the for loop. And please use [URL="http://www.daniweb.com/forums/announcement8-3.html"][B][noparse][CODE=syntax] ... code tags ... [/CODE][/noparse][/B][/URL]. They make your code easier to read. I suggest you read [URL="http://www.gidnetwork.com/b-38.html"]an article about …

Member Avatar for gnarlyskim
0
125
Member Avatar for aroma7

This is a very generic question, don't count on much help until you provide some specifics and give us an example of what you've done. This is spelled out quite clearly in the [URL="http://www.daniweb.com/forums/announcement8-2.html"]homework-related announcement[/URL] at the top of the thread listing. What do you know about classes?

Member Avatar for gnarlyskim
-2
101
Member Avatar for buzzykerbox

Didn't you ask this in [URL="http://www.daniweb.com/forums/thread272654.html"]your other "newbie" thread[/URL]? You have to compare to the word in your original word array, then place the character in the proper location in your "word_to_guess" array. If you assume the secret word is "freedom" and the user enters 'r' your loop would loop …

Member Avatar for Fbody
0
83
Member Avatar for biggie_smalls
Member Avatar for Fbody
0
193
Member Avatar for gastonci

You seem to be trying to shift array elements 1 element to the left. The second version is a better concept, but doesn't work how you think. The net result is no change, you'll just be copying the contents of an element back into itself. There is no change, because …

Member Avatar for gastonci
0
84
Member Avatar for Fbody

Is there an issue with the Site Search? It doesn't matter what search terms you enter it comes back with: [QUOTE=Site Search Response]Sorry - no matches. Please try some different terms[/QUOTE] To test, I did searches for "bit-fields", "bit fields", "bits" and that was all that I could get. I …

Member Avatar for Dani
0
154
Member Avatar for euclid135

Can you give us a better use case or some sort of algorithm? It almost sounds like you want some sort of [URL="http://www.cplusplus.com/reference/stl/map/"]map[/URL], but your post is a little confusing...

Member Avatar for euclid135
0
120
Member Avatar for buzzykerbox

There's not really enough here for us to tell how you are currently doing things. I think you might want to do something with parallel arrays. At minimum, have an array with the secret word and an array to track the revealed letters. Or is that what you are already …

Member Avatar for Lerner
0
183
Member Avatar for tallygal

Where do you get tamount from the user? All I see is a declaration without any sort of input or initialization before you write it to the file. This causes the variable to have a really weird value in it (a.k.a. "garbage"). In your browser, do a find with "tamount" …

Member Avatar for tallygal
0
134
Member Avatar for timbomo

Did you look in your other 2 threads concerning these questions? I told you how to generate the die faces in [URL="http://www.daniweb.com/forums/thread271936.html"]your "generate random number" thread[/URL]. To generate die faces you would take a random number modulus 6 (which generates 0-5) then add 1 (which shifts it to 1-6). This …

Member Avatar for timbomo
-1
118
Member Avatar for vivosmith

By default, Dev-C++ uses the MinGW compiler which is a pretty good compiler. I used to use Dev, but the problem I had with it is that, yes the interface is nice, but many of it's subsystems are not very well implemented. I don't really recommend it. The debugger is …

Member Avatar for vivosmith
0
580
Member Avatar for react05

Since moveNumber is a reference parameter, you should just be able to simply add a line to main(), immediately after the call to move(), that outputs moveNumber just like any other output sequence.

Member Avatar for Fbody
0
278
Member Avatar for rahul8590

Try changing line 35 to [iCODE]if ($flag == 1)[/iCODE]. You might need to change line 44 to some sort of elseif as well.

Member Avatar for rahul8590
0
138
Member Avatar for josolanes

It sounds to me like you need header guards in place as well. That way, if a specific header somehow gets #included more than once, the various instances of it aren't butting heads and you only get one set of definitions. [CODE] #ifndef HEADER_FILE_NAME //check for previous inclusion #define HEADER_FILE_NAME …

Member Avatar for josolanes
0
102
Member Avatar for mucoool

You need to send system() a string. Put [COLOR="Red"]c:\\new\\ram.bat[/COLOR] in double-quotes.

Member Avatar for thomas_naveen
0
206
Member Avatar for LunchBox_1001

Do a google search, then START YOUR OWN THREAD. Don't hijack, your topic isn't even related to the OP...

Member Avatar for Fbody
-2
259
Member Avatar for al-athari

All I see is someone barfing out a bunch of improperly-posted code and pleading for help... 1. Use [URL="http://www.daniweb.com/forums/announcement8-3.html"][B][noparse][CODE]...code tags...[/CODE][/noparse][/B][/URL] (click for more info) 2. Properly describe your problem. Without a description, all we can do is take a shot in the dark. I see alot of mismatched braces ('{' …

Member Avatar for Fbody
-1
216
Member Avatar for buzzykerbox

I know this is a bit of a "me too" post, but I thought I should clarify daviddoria's response. strlen() only works with C-style strings (null-terminated arrays of [B]char[/B]s). Since you are working with C++ std::strings you can not use it as you have. You need to use the member …

Member Avatar for buzzykerbox
0
101
Member Avatar for timbomo

[QUOTE=some;1175109]hello, it could just be with the placing of the function. Maybe you should try moving it around. I don't know it looks fine to me...[/QUOTE] Other than the fact you can't do this? [CODE]cout << ((turn_it_is%2)==1)?(play1:play2) << cout << " it's your turn ";[/CODE] Or that the variable name …

Member Avatar for Fbody
0
164
Member Avatar for MTW1989

Create another series of loops similar to your input loops. Just convert them to output and perform the necessary arithmetic operations inside them.

Member Avatar for Fbody
0
116
Member Avatar for 1bh

The way you wrote it is ambiguous. It could be a recursive reference to itself (which is technically undefined) or a call to one of the compiler's included pre-defined versions of the operator. Either way, I suspect that it does not match your intent. I'm not sure if it will …

Member Avatar for 1bh
0
166
Member Avatar for timbomo

[QUOTE=some;1175099]here is the code for generating random numbers [CODE]int which_Num; unsigned seed = time(0); srand(seed); which_Num = rand() % 5; [/CODE] The number 5 is the max number to be generated you can change it to whatever you need like 100 or 50 or in your case 6. After that …

Member Avatar for Fbody
0
297
Member Avatar for tennis

When you pass information into a function you do "make a copy of" the data. In that sense, you are correct. However, this is where you are incorrect: When you have an argument passed as a reference, or are passing in a pointer, the information passed/copied into the function is …

Member Avatar for Fbody
0
107
Member Avatar for Xlphos

[QUOTE=Nick Evan;1171719]I actually had to use babelfish to find out if you were making fun of my English :icon_neutral: . But: nice one! :)[/QUOTE] :confused: Your English seems really good to me... where are you from? I figured you were, at least, from an English-speaking country.... PS It took me …

Member Avatar for Nick Evan
0
213
Member Avatar for tennis

[B]delete[/B] is the keyword for dynamic [B]de-[/B]allocation of memory. I see no [B]new[/B] creating a dynamic allocation, so it is not needed. It is used with pointers, and I don't even see any pointers.

Member Avatar for Fbody
0
243
Member Avatar for Pynolathgeen

I know absolutely nothing about win32API and DirectX but... The keyword "new" generates a pointer to the specified class. How is the variable DirectX defined? Is it some sort of pointer, and if so, is it the correct type of pointer?

Member Avatar for tetron
0
131

The End.