389 Posted Topics

Member Avatar for jewelpervez

You have a computer in front of you! You may not have hardware, but you can still write your program for later testing! You do need to be careful of your test circuit. Is this an embedded processor with test board, or are you trying to build your own circuit? …

Member Avatar for ithelp
0
93
Member Avatar for gretty

You aren't keeping a tally, only existance of a number so how about using a bit array. 65,536 numbers 0x10000 range from 0 to 65,535. So technically you only need one bit per number. So let's assume you have 32-bit integers. Then 0x10000 / 0x0020 = 2048 slots, 32-bits each. …

Member Avatar for wildgoose
0
98
Member Avatar for patrick k

these are only some of your problems! You don't want 11 pointers, you want 11 tallies! [code] // int *arrayptr [11]; int arrayptr [11]; [/code] Shouldn't you pre-clear your tallies? [code] // for (control = 0; control < 12; control++) // arrayptr[control] = &timesrolled[control]; for (control = 0; control < …

Member Avatar for patrick k
0
113
Member Avatar for scarypajamas

There are several algorithms. Here are a couple... N degree angle passing though point B is a line from + infinity to - infinity. Which side of the line is point A? Inverse Tan y/x gives you the angle. of B-A

Member Avatar for scarypajamas
0
127
Member Avatar for J-P

Opacity is an alpha setting! Either master or each pixel. [code]DstRGB = (SrcRGB * SrcAlpha) + ((1.0 - SrcAlpha) * DstRGB)[/code] An alpha blending is similar to as follows [code=C] a = (1.0f / 255.0f) * (float)pSrc->a; d = 1.0f - a; pDst->b = (byte)((a * pSrc->b) + (d * …

Member Avatar for J-P
0
117
Member Avatar for NargalaX

I'm assuming you mean less then not lower? [code=C] if( x <= 50) { y = 5; } else { y = 2; } [/code] or [code=C] y = (x <= 50) ? 5 : 2;[/code]

Member Avatar for sknake
0
109
Member Avatar for madcat62
Member Avatar for sknake
0
152
Member Avatar for bigbadbag33

I haven't used Java in many years, but is using main a problem? public static void main( String args ) However, you appear to have a problem string string int double but your pass string string string double

Member Avatar for BestJewSinceJC
0
114
Member Avatar for Leniel

Do you realize you have 11 ages. You have three fixed arrays 10 elements in size but you are dynamically allocating number of people, entering them, then deleting the array without doing anything with it!

Member Avatar for Leniel
0
186
Member Avatar for Katvillan

You mention project. Is this a C class final project? Watch your [x][y] indexing. You called your roughed in getcoord(x,y) but in getcoord you did a [j][i]. There's nothing wrong with that but it does indicate that you might make a mistake later in your code due to confusion. Be …

Member Avatar for wildgoose
0
199
Member Avatar for karthik_cud

I'm not up on Visual Basic, but could the file be write protected? Is a COM type object wrapped in a DLL and the DLL isn't where you think it is? Application is looking in one spot and the DLL being built is in another? Release versus Debug difference? Just …

Member Avatar for sknake
0
85
Member Avatar for charlweed

Can you repost your code. It seemed like there was unattached code around line 18-31 but use indentation! And whitespace, its too cluttered! -- I've indented your code in an editor and don't see a real problem other then the new[] needed the one extra space for the terminator as …

Member Avatar for wildgoose
0
237
Member Avatar for xfreebornx

Code isn't make much sense either. You define factorial as a function but then you multiply 1 and 0 to it like a variable! And Please help doesn't state the problem. Your code is obviously flawed but we really don't know what the problem you are having is, and exactly …

Member Avatar for mrnutty
0
115
Member Avatar for Evil_genius82

Note your i range and j range they're in pairs! i is going one too many though the inner loop j is falling through so no problem but its not efficient! [code] // for (int i = 0; i < tranList.getSize(); i++) { for (int i = 0; i < …

Member Avatar for cgeier
0
223
Member Avatar for ryancfc

This definitely sounds like a homework assignment! Key here is you said lottery game. So sounds like you need a card shuffle algorithm for a deck of 49 cards, but you're only going to draw the first five cards. So assuming 49 balls in the deck! char balls[49]; Now initialize …

Member Avatar for ryancfc
0
174
Member Avatar for shea279

None of that has to do with C++. It can be wrapped in C++. There are a mutlitude of books on the subjects. Pick one and one only, then learn. When understood move on. Think of the aspects of programming as a dependency tree. You need to understand one concept …

Member Avatar for John A
0
271
Member Avatar for Lust_for_Pain

calculate_current has an indexing problem. [code] // for (int i=1; i<=12;i++) for (int i=0; i<12;i++) Totals[i]=0; [/code] Add comments to your code so it makes more sense! loop j is correct though! The following isn't doing what you think it does: [code] // if (data_for_months == 'Q' || 'q') if …

Member Avatar for Lust_for_Pain
0
70
Member Avatar for wardensmat08

I certainly hope you don't have an srand before each rand! Because that's a problem! [code] srand((unsigned) time(0)); <-- Stick me at top of program ONLY int cus_num=rand()%4, [/code] What time is it now? What time is it 0.0001 seconds from now? How fast is your computer? 1.8Gig, 2.8Gig? When …

Member Avatar for wildgoose
0
251
Member Avatar for dchunt

The first argument in.read requires is a pointer to a signed character buffer. The second is the length of that buffer. char c; But that is a signed buffer, which takes values in the range of -128...0...127 but you needed unsigned 0...255 so an unsigned char was used. unsigned char …

Member Avatar for Ancient Dragon
0
100
Member Avatar for cokaznsyco72

How about reversing in place [code] void reverse(char *wordPtr) { char c, *dstPtr; dstPtr = wordPtr + strlen( wordPtr ) - 1; while (wordPtr < dstPtr) { c = *wordPtr; *wordPtr++ = *dstPtr; *dstPtr-- = c; } [/code]

Member Avatar for cokaznsyco72
0
185
Member Avatar for TheSilverFox

It depends on your keyboard. it is not an absolute symbol, it is called a pipe. if you look carefully it's a dashed line, not a solid one! It is a conditional <OR>. A logical OR is as follows... A B A|B 0 0 0 0 1 1 1 0 …

Member Avatar for TheSilverFox
0
106
Member Avatar for CTUBren

I think you'r missing the point! They didn't want the dice history, only the statistics of the sums! [code] int sum[ 11 ]; // Zero sum array[] loop 36000 times dice1 = random 0...5 dice2 = random 0...5 sum[ dice1 + dice2 ]++; // 0...10 end loop [/code] Since you're …

Member Avatar for CTUBren
0
120
Member Avatar for Aphrodite

You may want to change the following line! To a caseless compare! You may merely have a case issue! Also do the same for END just in-case its not in upper-case! [code=CPP] // if (strcmp(aWord, wordRecPtr->word)==0) found=true; if (stricmp(aWord, wordRecPtr->word)==0) found=true; [/code] And make sure you keep the bool bFound …

Member Avatar for tux4life
0
147
Member Avatar for Jiro90

Sorry, too late for me tonight to pick this thing apart! What flowchart? The LCD is a 16x2, The PIC uses 32 byte LCD shadow buffer in ram. RA4 = LED L=On H=Off RA1 = LCD Enable 1=Enable __/--\__ RA0 = RS 0=instruction 1=data RB4...RB7 (out) are upper 4 bits …

Member Avatar for wildgoose
0
101
Member Avatar for MrNoob

char name[] in essence is a label that references the memory at that location. It is not a pointer. char *p = name; p is a pointer, occupies memory as a pointer that contains the address of memory that it references. Because it is a pointer, pointer math can be …

Member Avatar for MrNoob
0
105
Member Avatar for chat2fanna

And how long did you spend on this? Draw it on paper! Use multiple colors to work out insertions and removals. Your amount of code is inadequate. Maybe spend more time listening in the classroom and taking notes? Work on a team with fellow classmates? What I'm providing here is …

Member Avatar for wildgoose
0
148
Member Avatar for JasonL220

In this case is long 32-bit or 64-bit? You're treating it as 32-bit! I'm not sure what calling convention Java uses but please revise your code and repost! You can reduce your pointer addressing a tad, use scaling. I've tweaked a function but I noted a problem You are essentially …

Member Avatar for wildgoose
0
250
Member Avatar for BattlingMaxo
Member Avatar for masterjiraya

Sounds like a class assignment to me. There are plenty of free downloads for little tools thate give full processor specifications, CPU speed,video card, etc. If you're looking to do it yourself (like for a school project) if you are referring to an 80x86 then there's serveral CPU instructions one …

Member Avatar for wildgoose
0
210
Member Avatar for xiikryssiix

I think this is kind of what you're looking for! [code=C] student stud[3]; for (i = 0; i < 3; i++) EnterRecord( &stud[i] ); void EnterRecord( student *pRec ) { // Put your data entry per record here! } [/code]

Member Avatar for Salem
0
135
Member Avatar for alberton

Shouldn't you buy the Code Composer Studio IDE from Texas Instruments for their MSP430 processor? (Or atleast download their evaluation version available on their website?) Or look into the GCC ToolChain?

Member Avatar for jephthah
0
237
Member Avatar for karpaklu

Many ways. Review your trignometry, Sine, Cosine to be exact. There are ways to do it without trig, but trig is the simplest! You can also do it with two bitmaps. One contains an image. The second contains an alpha gradient. Ranging from 0% and the other 100%. The alpha …

Member Avatar for MrNoob
0
116
Member Avatar for wicked357

Make a high resolution random maze. I built one of these a very long time ago and pretty cool! Set all pixels on. Set the outer edge a different color. When you are done you'll have interlaced pixels of walls and paths. Assuming you only want one path through the …

Member Avatar for wildgoose
0
2K
Member Avatar for anuizath2007

you have a problem! You set c =2 inside the loop but add 2 to it at the bottom of the loop, which gets replaced at the top of the loop with 2 again. I made your factorial incremental so that your function runs faster. Also you're using floats' but …

Member Avatar for wildgoose
-1
135
Member Avatar for fuggles

Are you trying to send the entire array or one element? Sockets deal in chars! [code=C] int ary[100]; // send one integer in the array send( hSock, (char *)&ary[3], sizeof(int), 0 ); [/code] If sending the entire array, IT's TOO BIG!!! However if sending in chunks [code=C] // Send 100 …

Member Avatar for wildgoose
0
113
Member Avatar for anonymous23

We don't need to give you only. Cruise the posts and pick out a few you like! And then do them yourself!

Member Avatar for wildgoose
0
88
Member Avatar for rcbhat

What compiler are you using? Normally that is correct The contents of i is pushed 0 Then the output of the scan, 1 character scanned 1 So printout 1 0 If you're seeing the character pushed then your compiler functions differently! It's either parsing left to right, or is optimized …

Member Avatar for wildgoose
0
126
Member Avatar for calavan11

Several problem. Either Increase your array size [code=CPP] char Game[ 26 + 1 ]; [/code] Or use a (-1) index on everything. You're accepting a number from 1...26 but you're stuffing it in the array at 1...26. The array is 0...25 as it is 26 in size! So either Game[ …

Member Avatar for wildgoose
0
96
Member Avatar for dezza
Member Avatar for jlm699
0
375
Member Avatar for daimon

Ever hear of a friend class? But friends aren't allowed! SO, create an access function to READ ONLY the value. Within the base class. [code=CPP] class Foo { private: int nFruitCnt; public: Foo(); virtural ~Foo(); int GetFruitCount(void) { return nFruitCnt; } }; [/CODE] So any class that inherits this at …

Member Avatar for wildgoose
0
108
Member Avatar for didijc

Please excuse my ignorance but something here doesn't seem right! First of all this isn't a tree. It is a list!!!! A tree would have atleast two branches. GenTreeNode *childA; GenTreeNode *childB; I've picked on one of your functions that stood out the most with apparent problems. [code=CPP] GenTreeNode findNode(int …

Member Avatar for wildgoose
0
125
Member Avatar for Princy Rohit

Easy. You have a typicall Server-client situation. I normally work with Windows not Linux but you have a server that runs a Watchdog application. It establishes the verification, tracks number of authorized connections. Client applications connect to it, it does the authentication up to the threshold set and establishes the …

Member Avatar for Princy Rohit
0
113
Member Avatar for naeem1973

AHEM! You are only reading in one character with fgetc() Characters are a single byte. They will range from -128...0...127 since they're signed! (Or 0...255) the size of a byte, if characters are configured for 8-bit in the compiler! There won't be a value > 255! However you are running …

Member Avatar for Nick Evan
0
187
Member Avatar for lost_scotsman

You can use a structure to contain the data records. ASCII numerical data is converted into binary form and saved as such. Your ASCII text gets saved into a fixed length buffer within the structue record. A step below that is you use variable length records. Numerical data is written …

Member Avatar for lost_scotsman
3
982
Member Avatar for ShawnH

[NOPE! Unless, you use a more recent method where you turn on alpha, and alpha blit your images into the background instead of cookie cutting it with the old fashioned polyline. You should check if your version of windows can handle it. 95/98/ME can't, they have to use Region Cutting. …

Member Avatar for ShawnH
0
265
Member Avatar for misslb02
Member Avatar for xiikryssiix

There are a multitude of sorting algorithms! You aren't dealing with unsorted data, so you can do an insertion sort so as you enter a new number, you find its position in the list, stretch the list and insert it. If dealing with an array of data, the slowest but …

Member Avatar for xiikryssiix
0
194
Member Avatar for 666kennedy

(Removed due to finding on-line documentation counter to what I had posted!)

Member Avatar for wildgoose
0
5K
Member Avatar for newtechie

Ttextual scenario is about Engineering and System Design. Not game design! Only in games its called the T.D.D. (Technical Design Document).

Member Avatar for newtechie
0
123
Member Avatar for TheBeast32

Why are you mixing calloc's with realloc's. Primarily Realloc() does not always stretch the same memory!!!! It returns the pointer to the new (or stretched) memory. In your case it has stretched it as much as it could around character 13 the reallocated a new block of memory, copied your …

Member Avatar for wildgoose
0
192

The End.