- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
17 Posted Topics
Tried compiling it with default Visual Studio compiler but it's generating a lot of errors, mainly from variables being declared in the middle of the app instead of at the start of the function / conditional brackets.
My first guess is that when the object gets created it creates an array with the length (which is NULL / uninitialized at first). Then when you do .setLength() it stores it in listlength but it doesn't do anything with it, because the array code is only run when you …
The reason that you get 10395 instead of 945 is because you are doing 11*9*7*5*3*1 In your code you go one step too fast. Look: STEP 1.: 1 STEP 2.: 1 * 3 STEP 3.: 1 * 3 * 5 STEP 4.: 1 * 3 * 5 * 7 STEP …
Instead of scanning the whole array for 9's I would immediately increment adjacent fields as soon as your random generator chooses a spot. This will give you the possibility of doing useless increments. (If a mine gets planted on an incremented field) But it saves you the trouble of having …
Since giving the solution right away seems to be frowned upon, I guess I'll give a few hints. There are multiple ways to make this behave a bit more the way you want it to: One uses a different approach for which I will give the following hints: #include <stdlib.h> …
[url=http://www.daniweb.com/code/snippet216793.html]QuickSort![/url] Turns out someone posted a quicksort snippet on the daniweb snippets section.
You can create a seperate ''refresh'' function and run it every time you deposit / withdraw money to calculate the 'balance'. Then when someone chooses the balance option use printf("You have $%d on your account.",totalbalance); As for the loop to continuously keep withdrawing or depositing, you can do the same …
Actually 0-9 A-F can be used for both background and text-color
[url=http://en.wikipedia.org/wiki/Interpolation_search]Wikipedia Interpolation Search[/url] [url=http://en.wikipedia.org/wiki/Binary_search]Wikipedia Binary Search[/url] They both even come with example implementations :P
[code=C]#include <stdio.h> #define MAXLINE 1000 /* maximum input line length */ int getlines(char line[], int maxline); void copy(char to[], char from[]); /* print the longest input line */ main() { int len; /* current line length */ int max; /* maximum length seen so far */ char line[MAXLINE]; /* current …
Is it just me or are these: c_mark=c_mark/50*100; and x_mark=x_mark/50*100; unnecessary? Also please state what exactly you need help with.
If you want to get rid of the brackets I suggest *only* doing it when your conditional statement is followed by a single statement. (eg.: while(1) x = 2) If you need multiple lines to put it in (Like in your 2nd and 3rd version), just use brackets because it …
Visual Studio 2010 has a sequence diagram feature built in and should be available as a trial version. [url=http://www.microsoft.com/visualstudio/en-us/download]Here[/url]
They are mainly used for exit codes, similar to the EXIT_SUCCESS and EXIT_FAILURE terms. By nature they don't really do anything, but if a program has errorcodes defined, you can use them to find out what happened when the program quits. (Whether it quit properly or whether it didn't manage …
Start by posting this in the C++ section instead :P You should know that any language cannot be learned ''fast''. If you want to make anything more complicated then ''Hello world'' be prepared to put in a lot of time. Also google showed the following results: [url=http://www.learncpp.com/]LearnCPP[/url] [url=http://www.cplusplus.com/doc/tutorial/]C++ Language Tutorial[/url] …
Edited post (again :P) I guess I would say something like: "A linear list is a list in which each element has a single unique successor and/or predecessor, with the first and last element having no (a 'NULL') predecessor and successor respectively.". More information at: [url=http://en.wikipedia.org/wiki/Linked_list#Linear_and_circular_lists]Linked lists[/url] [10]->[20]->[30]->[40] = Single …
rand() isn't very good for random numbers, but your main problem is using srand() multiple times. You need to set it only once, or it will keep generating duplicate numbers, this is because when you set the seed, rand() "resets". Because the seed always generates the same pattern, you will …
The End.
[Alpha]-0mega-