1,358 Posted Topics

Member Avatar for kira_

Where do you define the type "node". I don't see where it is defined... That and (if I'm reading your main() correctly) I don't see where "word" is coming from. All I see is an undeclared variable.

Member Avatar for mitrmkar
0
106
Member Avatar for cpp.coder

What are you trying to accomplish? Do you want the function abc() to run based on zero/NULL or one (1)? The issue is the result of when the increment operator gets applied. Edit: eh ninja'd

Member Avatar for cpp.coder
0
200
Member Avatar for MonteM

We have no way of knowing what is wrong if you don't show us the appropriate portion of your code. Without it, all we can do is make wild guesses.

Member Avatar for Fbody
0
140
Member Avatar for em-kay

Have you done a site search? I seem to remember seeing this question before...

Member Avatar for em-kay
0
289
Member Avatar for micmagicfly

Ummm..... there's no input statement before your switch. It's completely bypassing it because there's no value in character.

Member Avatar for tetron
0
126
Member Avatar for josolanes

Do you have any implementation at all for the getStr() methods, or just the declarations? If you do have any implementation, it would be advisable to post it. The errors you mentioned generally indicate that the linker can't find the implementation of a function that it needs.

Member Avatar for mitrmkar
0
137
Member Avatar for MTW1989

Did you type this or copy/paste it? There are a couple things that I see that are blatantly wrong [code]const int numofgamesinseries = 3; const int numofplayersonteam = 4; int i,j, score[numofgamesinseries][numofplayerson… //<---what is this???[/codE] why the elipsis ('...')? In addition, it is difficult to see what is going on …

Member Avatar for MTW1989
0
196
Member Avatar for corby

Sodabread's version should work. I would suggest you be careful about array size though so that you don't overrun the boundaries of your arrays. You might consider adding a second "arraySize" parameter that holds the number of valid elements in the array.

Member Avatar for Sodabread
0
209
Member Avatar for merse

That function definition is not valid as written. Remove the semi-colon then it will be valid. You may set as many default parameters as you like regardless of the data types. You just need to be sure that any parameters with default values are at the end of the parameter …

Member Avatar for Fbody
0
128
Member Avatar for MyrtleTurtle

Your prototype doesn't match your definition Change this:[CODE]void runSim(int, int, int, int);[/CODE] To this:[CODE]void runSim(int ary[][COLS], int, int, int);[/CODE] And see what happens. This appears to be true for all instances...

Member Avatar for Fbody
0
246
Member Avatar for mosespascal

Here's some help: 1. [URL="http://www.lmgtfy.com/?q=site+translators"]Research "site translators"[/URL] 2. Find a piece of paper 3. Find a pen 4. Begin writing an algorithm 5. Begin translating algorithm to pseudocode/code 6. Get stuck on code 7. Come to DaniWeb to ask for help 8. Read the posting guidelines ([URL="http://www.daniweb.com/forums/announcement8-3.html"]link1[/URL]) ([URL="http://www.daniweb.com/forums/announcement8-2.html"]link2[/URL]) 9. Create …

Member Avatar for Fbody
-1
879
Member Avatar for 2009_53
Re: a

There are plenty of suggestions in existing threads, do a site search. [URL="http://www.daniweb.com/forums/announcement8-2.html"]Oh, and read this.[/URL]

Member Avatar for syd919
-2
91
Member Avatar for BrandonB

Thank you for at least trying to use code tags. But they didn't work because the syntax wasn't correct. The proper syntax is [b][noparse][code=syntax]...your code...[/code][/noparse][/b]. There is a pattern to the output in each line, what is that pattern? (hint: the pattern is patternSize characters long) Also, do you know …

Member Avatar for Fbody
1
573
Member Avatar for NeedHelpWithC++

[URL="http://www.daniweb.com/forums/announcement8-2.html"]It is a good place to get help, if you follow the rules.[/URL].

Member Avatar for creative_m
0
200
Member Avatar for jdpjtp910

You need to #include ship.h in cruiseship.h and cargoship.h. Without that inclusion, the Ship base class is completely unknown to them. Also, try changing name and year in your ship class to protected instead of private. With them being private, nothing but methods internal to ship can access them. Protected …

Member Avatar for lotrsimp12345
0
2K
Member Avatar for wwsoft

Are you looking for the bearing? You would need to use the inverse trig functions found in the <cmath> header then convert the answers from radians to degrees.

Member Avatar for daviddoria
0
169
Member Avatar for Fbody

I'm in the process of reworking a bit field that I built to condense a collection of rule activation flags for a game I'm working on. I need to change the "multiplierRule" so that it can represent 2 different variations of the same rule as well as an "inactive" state. …

Member Avatar for Dave Sinkula
0
378
Member Avatar for omgaga

[url=http://www.lmgtfy.com/?q=c%2B%2B+array]Have you tried this?[/url]

Member Avatar for Fbody
0
92
Member Avatar for BrandonB

It really isn't possible to cover every function/construct in the language in a single semester. I'm sure your instructor will not balk at the use of ceil(). A big part of programming classes is researching the language by digging into documentation and experimenting with new constructs. Unless they specifically say …

Member Avatar for BrandonB
0
141
Member Avatar for pvsumanbabu

They are stored in the same manner. The difference is that, except for the initial global declaration, the member can only be accessed via a method if it's private and it can be accessed directly if it's public. Just like any other member variable.

Member Avatar for Fbody
0
39
Member Avatar for rollon

When you program, you communicate with the computer and other programmers. Learning to organize your thoughts logically and communicate effectively will help alot. My first piece of advice: [QUOTE=rollon;1162997]OMG im a IT student but i am not good in programming!! can i ask some question how to be a good …

Member Avatar for wasimmalik
0
128
Member Avatar for mvblhp

If you're going to get technical, it's actually 5.20833 years old which makes hashinclude's number more accurate. Either way, there was no need to reply. Considering the OP only posted 5 times within less than a month of joining, they probably have completely forgotten about this post/thread.

Member Avatar for almostbob
0
174
Member Avatar for rectifryer

[CODE] string c,y,n; //<--- line 16[/CODE] From what I can see in the rest of your code, there should only be one variable here "c", and it really should be a char, not a string. I'll cover "y" and "n" later. [CODE] cout <<"Continue? Enter y or n"<<endl; ??<---line 45 …

Member Avatar for Banfa
0
403
Member Avatar for Valaraukar

Are the objects falling vertically or diagonally? It makes a big difference in the complexity.

Member Avatar for Fbody
0
90
Member Avatar for eternaloptimist

You've already included the iomanip header. Do some more research on it. Every thing you need is in that header.

Member Avatar for Fbody
-2
1K
Member Avatar for sikeufoo

[QUOTE=Banfa;1163119]How is y declared? You should perhaps check cin to make sure that no error has occured on it.[/QUOTE] I agree, it sounds like the stream is corrupted. An error trap may be advisable. @OP: Based on what I see, there must be some other input previous to this. It's …

Member Avatar for Fbody
0
135
Member Avatar for endframe

55 is the ASCII code for the character '7' and 49 is the ASCII code for the character '1'. This means that your program is functioning correctly, but you have an intent error. Your error appears to be that your array and key are defined as char instead of int …

Member Avatar for WaltP
0
110
Member Avatar for jino

How to update the second client directly is beyond me, if it's even possible. I suspect that responding to a keyboard event such as onkeypress should be able to start the process on the sending client though. The receiving client would probably have to poll the server for a status …

Member Avatar for Fbody
0
76
Member Avatar for kd1987

[QUOTE=kd1987;1161746]Hi thank you for replay . I know that it isn't good to return references to objects . [B]I'm writing program for somebody who is studying at the university. This is his homework and I can't modify this method.[/B] I'm just wondering if it's possible to do.[/QUOTE] Let me get …

Member Avatar for Fbody
0
96
Member Avatar for tajendra

[QUOTE=tajendra;1155081]Want to add one more point here in this discussion. "0" create less confusion, if we write "NULL" then again we have to check its definition moving across different platforms. Where as using "0" creates no confusion.[/QUOTE] You really need to read what others are telling you and stop being …

Member Avatar for tajendra
0
472
Member Avatar for keerpitis

All you need to do is use an if statement that compares to one of those chars. If it matches, end the read loop and begin your comparison loop.

Member Avatar for abhimanipal
0
83
Member Avatar for hawkoftheeye

If you need random access, I might suggest a vector instead. If you are only using sequential access, a list will work. Look into the function list::remove_if(). That should allow you to specify what "Alien"s to remove based on either postition or health.

Member Avatar for hawkoftheeye
0
133
Member Avatar for lethal.b
Member Avatar for yun

<form action="<?[COLOR="Red"]=[/COLOR]$_SERVER['PHP_SELF']?>" method="post"> I believe you have an extraneous '=' in there... Shouldn't that be an "echo"?

Member Avatar for diafol
0
133
Member Avatar for C Newbie

[QUOTE]Describe how the algorithm works. Trace the function with n = 100.[/QUOTE] This doesn't even involve coding. It is a written description of the function with a written list of the steps performed when "displayOctal()" is called with an initial argument of 100. It is essentially a simple algebra problem.

Member Avatar for C Newbie
0
264
Member Avatar for top123

For starters, you really need to work on your formatting, it's very hard to understand your code. Second, this: [CODE]for(int a=0;a<15;a++){ cout<<"enter value num #:"<<a<<endl; cin>>nums[a]; checknum[a]=nums[a]; }[/CODE] is going to cause errors. You are running from 0-14, which attempts to store 15 elements. Since your arrays only have 14 …

Member Avatar for top123
0
120
Member Avatar for smeghead007

[QUOTE=MyrtleTurtle;1155664]You can't compare an int value in your if statement. You could compare it if it was a bool though.[/QUOTE] Yes you can. You can use any numeric value/type in an if statement. The value zero (0) is interpreted as false and any non-zero value is interpreted as true. This …

Member Avatar for smeghead007
0
142
Member Avatar for skerdzius

Thanks for trying to use [b][noparse][code=syntax] ... code tags ... [/code][/noparse][/b]. They didn't work because your closing tag is incorrect. Take out the "=syntax" part and they should work. You have duplicated your class declaration. When you define a member function in a source file (a *.cpp file) that is …

Member Avatar for skerdzius
1
339
Member Avatar for enderes05

I think you need to double-check the assignment. If the people present is less than the capacity, there should be no issue [QUOTE]// i dont know what to do next here... i hate my instructor T_T[/QUOTE] This is completely immature. This is not an issue with your instructor. This is …

Member Avatar for enderes05
0
104
Member Avatar for Kosithc

Are your headers vendor-supplied or self-written? Due to the multiple declaration issue, I'm wondering if they're not properly guarded. Either that, or a couple of the errors make it look like there is an issue with namespaces. I see a couple errors that seem to be mentioning std::allocator(s) as a …

Member Avatar for Kosithc
0
632
Member Avatar for avataralien

It means that bits 3-7 aren't relevant to the problem domain and that the programmer is ignoring whatever data they may happen to contain. You still need to take them into account in the bit field structure though so that the rest of your data lines up properly. Since they …

Member Avatar for Fbody
0
74
Member Avatar for josolanes

Since you're on Linux, perhaps a Bit Field would work (a bitset probably would too, but I don't know how to use those). Set up 3 unsigned 8-bit fields, then use one field for each color. They would be more portable than a Windows library. [CODE] //an example bit field: …

Member Avatar for josolanes
0
2K
Member Avatar for matharoo

AD is not confused he gave you a generic example. Take his function and modify it to 2 arguments of the appropriate classes.

Member Avatar for Ancient Dragon
0
137
Member Avatar for PDB1982

[QUOTE=firstPerson;1154980]Hint : check your set functions, specifically, check the name of the parameter.[/QUOTE] He needs more than that, first. Have a closer look at the structure of the class and his main(). @OP: Your output is "garbled" because you clearly don't understand how classes and objects work. [URL="http://www.cplusplus.com/doc/tutorial/functions/"]Read this function …

Member Avatar for tetron
0
530
Member Avatar for rpgwebsolutions
Member Avatar for D4n1sD
Member Avatar for CodyOebel
0
128
Member Avatar for faraz101

Since it's printing out your PHP scripts, rather than processing them, it sounds like the issue is with your installation of PHP itself. What are the exact filenames of your form and "action script"? You may need to modify the configuration for your webserver so that it knows it needs …

Member Avatar for Fbody
0
113
Member Avatar for reeddp1

You need to be more careful about your variable names and scoping rules. You generally want to call your member variables something along the lines of "[B]m[/B]VarName" or "[B]my[/B]VarName" and your functions' local variables (parameters and locally-defined) something else such as "[B]new[/B]VarName" or "[B]local[/B]VarName". What is happening is you are …

Member Avatar for Fbody
0
670
Member Avatar for fhast

Take out the comparison completely. If cin returns EOF, it should automatically terminate. [CODE]while (cin >> a){ statement ... }[/CODE] is a completely valid construct. The only thing you have to watch for is the data type of "a" (which appears to be numeric, per your C example). If the …

Member Avatar for strmstn
0
134
Member Avatar for mrcniceguy

Cut your selected columns down to a specific set of columns then add the DISTINCT keyword to the appropriate column(s). i.e.: SELECT postId, [B]DISTINCT[/B] userId, emailAddress, (etc...) FROM ......

Member Avatar for mrcniceguy
0
106

The End.