- Strength to Increase Rep
- +10
- Strength to Decrease Rep
- -2
- Upvotes Received
- 195
- Posts with Upvotes
- 167
- Upvoting Members
- 99
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
Geeky programmer looking for the meaning of life, which so far seems to have very little to do with software
- Interests
- I have a daughter and therefore I have no time for interests...Oh ok RPG (the proper table top variety)
- PC Specs
- Home: Core 2 Duo Desktop Triple Booting Ubuntu/Vista/XP Work: Core 2 Duo Laptop WinXP and Core 2 Workstation…
Re: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Rich Cook | |
Re: Seems we tend to get most irrate at the things we know and therefore stand out most to us as being wrong. A friend of mine who had been a train driver used to get excptionally irrate at how TV/movie trains react to things on the line vis-a-vis a) There … | |
Re: USART and SPI generally do different things and both tend to be 3 wire connections (because they require a ground). 2 wire connections tend to be used on a single PCB and don't require a ground because it would be extrememly unusual for a single PCB to have more than … | |
Re: I think you mean [b]L[/b]d returned 1 exit status. Do you really mean you tried to link the 2 c files and the h file or do you mean you compiled the c files and tried to link the resulting objects? The processor of building a program is [list] [*]Compile … | |
Re: Youve missed to top of your code 1. The easiest way to put a repeat into a game once it is already working is to move the whole game into a function, then add your loop that askes the user if they want to repeat in main and call the … | |
Re: Your method, BankAccount::NewBankAccount seems to be strangely named and you haven't included the code for it. I would more normally expect to see this sort of polymorpic behaviour implemented through a base class pointer BankAccount* acct = NULL; if (TypeToCreate == Normal) { acct = new BankAccount(name); } else if … | |
Re: I think that rather begs the question why would you want to create a package that either doesn't have a sender or doesn't have a receiver? Almost by definition a package should have both. Building on what @rubberman provided you can easily do this just by using the default constructor … | |
Re: "Why i can compile the program ?" this is a strange question, you can compile the program because you have a computer with a compiler on it ??? I suggest you try asking the question you actually want answered, are you getting compiler errors? Then post them. You have an … | |
Re: In both cases you have the following problems 1. `scanf("%d ", &shift);` the space after the %d is superfluous and could cause issues, remove it. 2. scanf will likely leave the '\n' (newline) after the number in the input stream which means in both cases the first character read by … | |
Re: You could simplify this by only putting the calculation of the monthly reward in the switch statement, i.e. double reward; /* printf/scanf statements to get membership and monthly purchase */ switch(membershiptype) { /* Cases to calculate the monthly reward and store in reward */ } /* printf statements to output … | |
Re: Remember that strtok (which frankly I would avoid using if possible) works by overwriting the delimiters with '\0', it is not deleting anything. It returns pointers into the original string. So when you call char *token; token = strtok("greetings pe()ple", "()"); it scans forward until it finds the '(', replaces … | |
Re: Firstly there is no need to use capitals that is generally consider rude as it is normally taken to equate to shouting. Posting the code will make easier for us to help. Posting a copy and past of the actual compiler output will make easier for us to help. I … | |
Re: Line 171 is redundent, it repeats line 168. The problem is line 169 temp->previous = new_node->previous; You are inserting the new node after temp so `temp->previous` should not change. `new_node` is ... well new, and so its previous pointer is set to NULL, you overwrite a value that does not … | |
Re: It rather depends on what the function is supposed to do, the function you have written assumes that the calling code has cast a bytearray to a void pointer to pass into the function (a somewhat pointless exercise in C++) liek this bytearry data; function((void*)&data); The bytearray create in func … | |
Re: There are all sorts of algorithms you can use, the problem with sorting a singley linked list is in removing an item from the centre of the list requires that you have a pointer to the the item before the item you want to remove (because it has a pointer … | |
Re: This is because fgets effective consumes the newline for you and fscanf doesn't I assume your file is R XXXX R DISNEY Remember at the end of each line is a newline character so the file can be presented by the character stream R XXXX\nR DISNEY\n This is an important … | |
Re: Looks like you are compiling very old legancy c code and like you are using a c compiler. C does not support function overloading so basically this error is saying you declared the function create_timer one way and now it has come accross another declaration that is different, has a … | |
Re: > If you exchange a block of m grams, you get three blocks of weight m/2, m/3 and m/4 grams each. Is the important part of this question because 1/2 + 1/3 + 1/4 = 13/12 or more than you started with. However, fractions are rounded down, so for example … | |
Re: At line 19 and 20 you are using the symbols `sys_nerr` and `sys_errlist` but this is the first time the compiler has seen them, you have not previously declared them anywhere hence they are "undeclared". You may have missed out a header file in which they are declared or you … | |
| Re: Wrapper classes don't have to encapsulate another class, they can for instance encapsulte a legacy C interface or in your case a propriatory interface to some board. If you are trying to implement the same wrapper interface for 2 different boards it is worth using an interface class so that … |
Re: For the main to work you would have to change the output lines to cout << v1 <<" * "<< v2<< " = " << dot(v1, v2) << endl; All of your methods pass by value, Vector2D does not contain 2 much data, 2 doubles and a bool so about … | |
Re: Your while loop, lines 17 - 26 puts your list together in reverse order, so the first numbered entered appears at the end of the list and the last number entered at the beginning, because you keep adding to the front by altering `first`. That's OK it is the simplest … | |
Re: Your condition at line 45 `if(exp >= 10)` is wrong. Remeber that any number raise to the power of 0 is 1 but this is not what is embodied by your condition. I would also say you are missing a newline or 2 at line 43. Also storing exp as … | |
Re: At line 24 remove the `this` because that makes the current class (window/widget) the parent but line 36 tries to make the `_verticalLayout` the parent too and causes the warning since the parent is already set. | |
Re: Actually your code compiles fine, but it fails to link because in binTree.h you declare all the functions in the template class binTree but you don't define any of them. You need to write the imlementation of all those functions. | |
Re: libpcap is just the library that enables you to capture the network traffic, if the data you are capturing is not a protocol that WireShark already handles then your only options are to extract the data by hand (i.e. copy it off the screen or export to a text format … | |
Re: > Everything works fine if I use #include "Error_Handler.h" in the code. But #include "ErrorHandler.h" Typo in post or actual mistake? That said it would still help to see a few lines of code round the line producing the error. Also is this the first compiler error you get, if … | |
Re: **Line 54** template<class T > T display_array(T ItemType[10] , T const int arraySize) This is invalid. Remeber that the compiler will substitude the type T in the template into the code provided in order to instatiate the function for you. You can do this by hand and should get the … | |
Re: Subscriber::update, Subscriber::alter and Subscriber::noMessage all sound like they are doing the same thing and should be a single method. For the operation you want to perform you are missing an operation in Blackboard because there is no way to get the current message, you need a BlackBoard::getMessage method. Blackboard::notify and … | |
Re: Your are deleting memory that is in use and you are mixing heap and stack memory and trying to delete stack memory, all in `Sport::add`. You are using dynamic arrays of pointers so Line 194 - 201: Allocate a new array of pointers (`temp`) copy pointers from `array` to `temp` … |