389 Posted Topics

Member Avatar for Dragonfyre

I'm rusty with Java but... Watch your [] positioning. Also array is an int [] not a class! But you have array.length [CODE=JAVA] BubbleSort( array[], length ); public class BubbleSort { // public int trade( int[]array, int length) public int trade( int array[], int length ) { [/CODE] Can we …

Member Avatar for Dragonfyre
0
119
Member Avatar for Cromarte888

You don't seem to be stuffing the letter! To save it! Or some indication you have that letter within the word that was already tested! [CODE=C] if (gameGuess == gameWord[i]) // matching letter found? { myWord[i] = gameGuess; // <---- Stuff new letter cout << gameGuess; } else if (myWord[i] …

Member Avatar for Cromarte888
0
232
Member Avatar for born_to_code

I too don't exactly see what you're trying to do, however you are using temp before you set it! It's almost like you're trying to create a new list containing characters that occur in both strings. But your algorithm is flawed if so!

Member Avatar for Tom Gunn
0
1K
Member Avatar for deostroll

You're pretty much covered by the other posts but you do need to be more careful of what instructions you use. In this case you're fine, but... [CODE] ; add ax, 30h ; mov [bx], ax add al, 30h mov [bx],al add bx, 1 mov byte ptr [bx], '$' [/CODE] …

Member Avatar for wildgoose
0
2K
Member Avatar for hoti99

You want to write your own strcat function? Or you merely want to append two strings together in a buffer? Either way, [CODE] dec di mov al,0 l1: inc di ; scan for end of destination buffer test ds:[di],al jnz l1 l2: mov al,[si] ; copy src buffer to destination …

Member Avatar for wildgoose
0
725
Member Avatar for wicked357

Not enought code, to help you, however Loop decrements ecx and checks for zero. So unless <number> is the loop count, there's a problem.

Member Avatar for wicked357
0
137
Member Avatar for dknoebber
Member Avatar for DoEds
0
196
Member Avatar for dzhugashvili

Memory alignment? See if your data is 16 byte aligned. If the internal algorithm is using SIMD it will run faster when aligned. If misaligned data has to be double copied, or accessed slower. memcpy is also faster if properly aligned!

Member Avatar for dzhugashvili
0
124
Member Avatar for jcollins85

I remember MAC being either '\r' or '\n' only, while PC is definitely '\r' AND '\n' every time a '\n' is encoded!

Member Avatar for jcollins85
0
156
Member Avatar for MrNoob

You have an (i) problem. You need to use two different variables within a nested loop, such as i and j. [CODE=C] for(i=0;i<2;i++) // for(i=0;i<3;i++) { for(x = 0; x < 3; x++ ) { total+=num[i][x]; } [/CODE]

Member Avatar for MrNoob
0
149
Member Avatar for Shaitan00

I personally like the idea (which I use) of a local IP port using a simple message protocol. Your Host Server App opens a listener port on a specified port # using the local IP 127.0.0.1 Your Client App's merely connect to it!

Member Avatar for Ancient Dragon
0
265
Member Avatar for VernonDozier

Technically each memory you allocated has a hidden header and has been tagged and associated with your application. When it shuts down the memory allocated will be released back to the pool. In reality, you MUST ALWAYS release any memory you allocate, just to be a proper (PROFESSIONALLY WRITTEN) application. …

Member Avatar for wildgoose
0
188
Member Avatar for dp_neo

I don't know Python but from an architectural point of view your answer is YES! You said after hours, which implies that nobody is using the computer so it is free to use 100% of its time doing the processing. Dual Core machine doing single-threadded means less then 50% of …

Member Avatar for wildgoose
0
138
Member Avatar for nagash07

This should be the last edit line of your ASM file. (Leave atleast one blank line below it!) [CODE] END [/CODE] Believe it or not, assemblers still require the END keyword. Does this help? One question though. Why do you have this DOS code at the bottom of your file? …

Member Avatar for wildgoose
0
235
Member Avatar for ragnarok511

I see a problem but this line doesn't belong! [CODE] if (i < 0) { System.out.println("There are no books avalible"); break; } [/CODE] also at the top of your code... You're returning the garbage pointer after the allocated buffer. [CODE] books[numBooks] = new Book(bookTitle); // ++numBooks; // return books[numBooks]; <--- …

Member Avatar for kvprajapati
0
166
Member Avatar for scripter_tmrage

Choices in preferable order... 1) Go back to school, get your Bachelors Degree in Computer Science. 2) Go back to school, take game development - programming at one of those I.T. schools. 3) Teach yourself, if very good and extremely lucky and beat out the interview competition, you'll get the …

Member Avatar for wildgoose
0
220
Member Avatar for hwaterboys

You get your initial index but you'r stuck in a loop until you find a non-one! But you never wrap your index! [CODE] while (status_arr[hashIndex] == 1) { // hashIndex ++; hashIndex = (1+hashIndex) % HTableSize; } [/CODE] What happens if no non-ones are found? Infinite loop? Also right now, …

Member Avatar for hwaterboys
0
123
Member Avatar for mrnutty

How about a sphere instead? But keep it on a z = 0 plane to keep it 2D.

Member Avatar for MattEvans
0
139
Member Avatar for rcbhat

Because you're only swapping within the scope of the function. Instead you need to pass the address of the pointers, not the memory referenced by those pointers! Despite that, line 21 was wrong! [CODE=C] void swap(char *,char *); main() { char *x="new"; char *y="word"; swap( &x, &y ); printf("(%s,%s)",x,y); } …

Member Avatar for tuse
0
291
Member Avatar for urbancalli

Also read up about "Expression Evaluators". These can be fun to build! Start simply two operands, one operator! then work up! Processing 3 * 4 is easy Processing 2 + 3 * 4 Is a bit more complicated. Processing 2 + 3 * (4 +(99 / 9)) Takes a good …

Member Avatar for siddhant3s
0
184
Member Avatar for sonia sardana

You're essentially looking for a card shuffle algorithm but you're using 101 cards. This isn't VB but the principal logic is the same! [CODE=C] LOWCOUNT = 0 HIGHCOUNT = 100 NUM_COUNT = ((HIGHCOUNT - LOWCOUNT)+1) Ary[ NUM_COUNT] // Fill with sequential numbers! for i = 0; i < NUM_COUNT i++ …

Member Avatar for sonia sardana
0
254
Member Avatar for llemes4011

Bit Magic. You need to post the types of data you wish to store and what the maximum number range is for each! There are many books on the subject! Did you know you can use bit data instead of code branching for faster code in some cases? But keep …

Member Avatar for llemes4011
0
481
Member Avatar for BlackJackVr

val1 = func( &apple, &bat, &cat, &dog ) The address of apple, bat, cat, and dog are now on the stack. here's one method! [CODE] ZZ equ ???? ; I forget the actual number to use try 8? Check your address of those arguments, then in debugger to align them. …

Member Avatar for NotNull
0
151
Member Avatar for lancevo3

You probably already know this but don't forget the +1 in the allocation for storing the terminator. [CODE=C] sz = strlen( s ); char *p = new char[ sz+1 ] [/CODE]

Member Avatar for lancevo3
0
338
Member Avatar for dennbibbs

Sounds like homework questions to me! Do web search or read your book!

Member Avatar for niks1241
0
122
Member Avatar for dcm882003

Some confusing bits in your code. Sometimes you start your column loop with 1 and sometimes 0. If you used CODE=C you would get line numbers for reference! Remove *rowcount = row; *colcount = col; from within the double loop. You pass in an array of known fixed size MAXCOL …

Member Avatar for wildgoose
0
124
Member Avatar for catchmrbharath

Since you don't know how many factorials there are then use an empty array of N / 2, thus 100 / 2 = 50. Most of it will be wasted but that's fine. Alternatively you'd have to use a dynamic array like an inch worm. Preset a size, fill one …

Member Avatar for siddhant3s
0
102
Member Avatar for paulnewman
Member Avatar for Chargers 21

Your RNG mod is wrong. 1 to 1000 thus 0 to 999 randomNum = 1 +(rand() % 1000); your test is not with your drawn random number! //if (guess != rand()) if (guess != randomNum) Rework your code. Use one input point. Do while loop works.

Member Avatar for Lerner
0
121
Member Avatar for ckaiser813

In Real Mode!! DS:1342h Offset:015Ah Real Mode has 1 Meg limit. Segments are on 16 byte boundaries. So Segment x 16 + offset 13420h + 015Ah = 1357Ah Decimal 79226

Member Avatar for wildgoose
0
45
Member Avatar for GDICommander

Just briefly unless your assignment is to use a malloc() you don't need it here... [CODE] widthStr = (char*) malloc(5 * sizeof(char)); heightStr = (char*) malloc(5 * sizeof(char)); //Lecture des dimensions de la grille initiale. fgets(heightStr, 5, grid); fgets(widthStr, 5, grid); //On enlève le "\n" au bout des dimensions. heightStr[strlen(heightStr) …

Member Avatar for jephthah
0
302
Member Avatar for jooa

Without a structure... It is unclear what you want! You have a 10x10 array and you want to count everytime that area of the screen is clicked in the cell corresponding to that area, or merely store the X,Y in all the positions?

Member Avatar for jooa
0
4K
Member Avatar for aveek

You're talking about a spline! Will there only ever be three points or merely looking at the current three points in an array of points. Do you want the curve to pass through the points or use them as a guide for placing a smooth curve! If you're on the …

Member Avatar for VernonDozier
0
95
Member Avatar for edenn1

It's hard to tell from your code since not much whitespace thus hard to read but it appears you're using a linked node before verifying it even exists? You check the base node for NULL but not the friend pointer, you just use it! [CODE=C] if(friend1->friends->person->id [/CODE] This isn't the …

Member Avatar for wildgoose
-1
182
Member Avatar for Clawsy
Member Avatar for Clawsy
0
4K
Member Avatar for qkslvr1621

An error.. You had a semi-colon on the if() [CODE=C] int main() { double input, answer; double total = 0; unsigned int count = 0; while (cin >> input) { if ((0.0 <= input) && (input <= 100.0)) { // Track number of entries, and sum the running tally. // …

Member Avatar for wildgoose
0
135
Member Avatar for lancevo3

Many problems. You're mixing class vs non-class string handling. Use what I'm providing to rework your functions. [CODE=C] const MyString& MyString::operator=(const char* rightOp) { int i = 0; if (NULL != stringStorage) { delete[] stringStorage; } stringSize = strlen( rightOp ); stringStorage = new char[ stringSize + 1 ]; for( …

Member Avatar for wildgoose
0
248
Member Avatar for kramer4583

Use a tag... [CODE=C] for line numbering. You have a comparison vs assignment problem for sure.... in two different parts of your code! Please try to align your columns to make the code easier to read! [CODE=C] if (chips1= 0) if (chips2= 0) should be if (chips1== 0) if (chips2 …

Member Avatar for kramer4583
0
187
Member Avatar for emint
Member Avatar for emint
0
107
Member Avatar for ivanhuk

Did you notice your copy assignments are backwards? [CODE=C] void Question::setnumq(int number) { // number = numq; numq = number; } void Question::setnum(int number) { // number = num; num = number; } void Question::setn(int number) { // number = n; n = number; } [/CODE]

Member Avatar for Lerner
0
145
Member Avatar for orangejuice2005

You may want to mention it is OpenGL. I cut in my own textures and Kind of cool, but I only see one blue planet. Adding your textures would be cool. If you're worried about copy cats, Put a big X or something on your textures so that they still …

Member Avatar for wildgoose
0
160
Member Avatar for shopnobhumi

These sound like teacher assigned problems for you to resolve so I am not going to give you the answer. But I will try to make the array more visual. 24 = sizeof( int b[3][2] ); XX XX XX Array is 2 wide by 3 high. 3 times 2 is …

Member Avatar for Ancient Dragon
0
174
Member Avatar for teddyg18

If you merely want a tool, doesn't Microsoft Word have a statistics page indicating number of words in a document? Open the file with that. I use ASCII parsers all the time. ASE file readers, etc. I actually treat it as a gigantic ASCIIz buffer. Get File size allocate size …

Member Avatar for teddyg18
0
6K
Member Avatar for Darkmorgaine

Your german needs some work! Review your one's list! vw[] zero and one are missing. 10 should be at the end of the list!

Member Avatar for sotvisal
0
234
Member Avatar for Kadence

All my Windows work is still under Win32. Remember in 32-bit land you only have about 3.2Gig totally available to your application, which really works out to about 2Gig because Dev Studio is an oinker! It's a memory hog! Especially in a debug build. You're using C++ compilers and using …

Member Avatar for jbennet
0
159
Member Avatar for kirennian

[CODE=C] if ( ERROR_SUCCESS != RegCreateKeyEx( HKEY_LOCAL_MACHINE, xREGISTRY_CRYPT_KEY, 0, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &dw ) ) { return false; } RegSetValueEx( hKey, xREGISTRY_UA, NULL, REG_DWORD, (BYTE *) &ua, sizeof( ua ) ); [/CODE]

Member Avatar for wildgoose
0
673
Member Avatar for zeus1216gw

if your current posting is correct, sum=0 is in the wrong place. It should be at the top of the function outside the loop. Not reset each pass through the loop! What Vernon Dozler said at the bottom of the post!

Member Avatar for zeus1216gw
0
100
Member Avatar for 9868

One method is to have order your instructions call functions above it, so main() would always be the last function! [CODE=C] #include<stdio.h> int f(int aa,float bb) { return (aa+bb); } int main(void) { int a; a=f(10,3.14); printf("%d",a); } [/CODE]

Member Avatar for jephthah
0
291
Member Avatar for NewToThis

Ahem! Given only radius gives you all the other data. No need to input. Circumference = 2 * PI * r Area = PI * r * r etc. I'm also assuming your x is entered as a Floating-Point value. [CODE=JAVA] System.out.printf("Area is %f\n", (x * x * math.PI) ); …

Member Avatar for NewToThis
0
102
Member Avatar for Pavan_

BOOM! That's a technical term! Your pointer needs to be pointing at real data! [CODE=C] int *k, v; k = &v; // k now points to the address of {v}. *k=10; // So we are now storing the value // reference by k, meaning v is now equal to 10. …

Member Avatar for tux4life
0
245

The End.