1,358 Posted Topics
Re: 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. | |
Re: 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 | |
Re: 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. | |
Re: Have you done a site search? I seem to remember seeing this question before... | |
Re: Ummm..... there's no input statement before your switch. It's completely bypassing it because there's no value in character. | |
Re: 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. | |
Re: 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 … | |
Re: 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. | |
Re: 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 … | |
Re: 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... | |
Re: 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 … | |
Re: 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] | |
Re: 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 … | |
Re: [URL="http://www.daniweb.com/forums/announcement8-2.html"]It is a good place to get help, if you follow the rules.[/URL]. | |
Re: 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 … | |
Re: 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. | |
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. … | |
Re: [url=http://www.lmgtfy.com/?q=c%2B%2B+array]Have you tried this?[/url] | |
Re: 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 … | |
Re: 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. | |
Re: 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 … | |
Re: 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. | |
Re: [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 … | |
Re: Are the objects falling vertically or diagonally? It makes a big difference in the complexity. | |
Re: You've already included the iomanip header. Do some more research on it. Every thing you need is in that header. | |
Re: [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 … | |
Re: 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 … | |
Re: 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 … | |
Re: [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 … | |
Re: [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 … | |
Re: 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. | |
Re: 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. | |
Re: <form action="<?[COLOR="Red"]=[/COLOR]$_SERVER['PHP_SELF']?>" method="post"> I believe you have an extraneous '=' in there... Shouldn't that be an "echo"? ![]() | |
Re: [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. | |
Re: 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 … | |
Re: [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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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: … | |
Re: AD is not confused he gave you a generic example. Take his function and modify it to 2 arguments of the appropriate classes. | |
Re: [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 … | |
Re: Look at the function definition and count them??? :icon_rolleyes: | |
Re: Look up Allegro. I hear it's pretty good. Never used it myself though. | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 ...... |
The End.