389 Posted Topics

Member Avatar for Cloneminds

Ignoring the return issue for the moment... Sales will fall right through the loop! double sales = 0.0; while (sales != 0) You set it to zero, then loop while not zero!

Member Avatar for wildgoose
0
226
Member Avatar for slomad1956

You converted your ASCII numberical value to a Floating-Point value with... [CODE=C] floatValue = atof(buffer); // this returns the same value!!! [/CODE] So just multiply the result by two! [CODE=C] floatValue *= 2.0f; [/CODE] Or did I miss what you were really asking for?

Member Avatar for slomad1956
0
128
Member Avatar for Pokenerd

Were you trying to do a Null terminator check? if(num == 0 && !(buf == "0")) { vs if(num == 0 || !*buf) {

Member Avatar for Pokenerd
0
105
Member Avatar for functionalCode

I'm not sure what you're asking for. You can get/set the user value associated with a list/combo item. You can add and remove items.

Member Avatar for functionalCode
0
186
Member Avatar for Pokenerd

You're trying to test a numerical value for an ASCII character! if(!isdigit(nCelsius)) isdigit( char ) thus "9834" first character '9' But its encoded as 9834 an integer. What they said! Simultaneous posting!

Member Avatar for Pokenerd
0
180
Member Avatar for jda

Just a thought [CODE] const float Y1 = (2 * SQRT2) / 7 - 1 / 7; const float Y2 = (4 * SQRT2) / 7 - 2 / 7; const float Y3 = SQRT2 / 2; const float Y4 = (3 * SQRT2) / 7 + 2 / 7; …

Member Avatar for jda
0
1K
Member Avatar for Pokenerd

You're equating, not comparing.. if(cDoContinue = 'n'){ should be if(cDoContinue == 'n'){ better yet if( tolower(cDoContinue) == 'n'){

Member Avatar for wildgoose
0
121
Member Avatar for joe82

A file is not elastic so two ways. 1) copy file A to file B but skip over the parts of file A you don't want copied! 2) invalidate the data! Write a 'bad' character code over fields in the data you don't like. The file size will remain the …

Member Avatar for joe82
-1
179
Member Avatar for zeus1216gw

You had x items y count per line! Please write your code and post for our review! [CODE] while x > 0 n = min( x, y ) x -= n while (n) print the rnd # end print the end of line. end [/CODE]

Member Avatar for csurfer
0
116
Member Avatar for ngjinjin

Put a counter on the interrupt and pre-clear, then after a short while, examine the counter and see if it is non zero!

Member Avatar for Nick Evan
0
191
Member Avatar for stevenaseron

There are many sort algorithms in existance. The simplest but slowest is you have all your values in an array and you know the count of the array. [CODE] swap = true while swap is true swap = false for index = 0 to cnt-1 step 1 if ary[index] > …

Member Avatar for stevenaseron
0
141
Member Avatar for eXsolved

You should definitely split the work load between threads, Render thread should ONLY handle rendering, but the output of the physics and other threads that alter the data the rendering thread uses should be in a request form. Data is kept separate but a shadow copy of the data the …

Member Avatar for wildgoose
0
177
Member Avatar for MrNoob

I see several problems. You would have found them immediately if you had typedef enum's but here goes. You enter types 1,2,3 but you submit them for processing as type artichokes, artichokes, artichokes. Also your data entry is confusing. You should enter weight and product type, pass it as such, …

Member Avatar for MrNoob
0
152
Member Avatar for jessejamesjjr

Ditto as to what CSurfer said. Also you need an exist but empty file handler! Meaning file exists but empty, thus no data read thus BOOM! Divide by zero! You need a zero case handler! I'd also recommend to write clean code! Something teachers don't teach from the old C …

Member Avatar for wildgoose
0
175
Member Avatar for lotrsimp12345

You have several problems. But first, was it requested that you enter the maximum number of characters or did you decide that your self? If yourself then merely use a large static buffer and watch when you're approaching the end of buffer. And set a certain keyboard character to be …

Member Avatar for smart_pc
0
226
Member Avatar for monkey_king

untested but here... [CODE] int main() { char tmp_array[100]; const char* seq = "+1236,,..,,actgn+3ACT-4CCCC"; printf("%s\n",seq); while (*seq) { // pre-scan for +- if (*seq != '-' && *seq != '+') { seq++; continue; } char *p = tmparray; *p++ = *seq++; while (*seq) { if ((*seq < '0') || ('9' …

Member Avatar for Yrth
0
151
Member Avatar for mario20055

Open the file with the sharing flag set will give you some flexibility. If you want your program to delete a file clean due to corruption, etc. you can use one of the following! Simple CRun time library call. [CODE=C] #include <io.h> remove( "HowdyDoody.txt" ); [/CODE] And since you're using …

Member Avatar for mario20055
0
2K
Member Avatar for thilinam

I'd recommend a container class where you pass two axis but gets resolved to a single array allocation. This is only one example of how to solve this! [CODE] class IntArray { private: int *pInt; unsigned int nWidth; unsigned int nHeight; public: IntArray( unsigned int w, unsigned int h ); …

Member Avatar for Ancient Dragon
0
162
Member Avatar for fernando82

You have to parse each field and check to see if its legitimate. Also check the day number to number of days in that month. And double check if its a leap year or not. You could parse and convert to Julian and store as a 32-bit number. You may …

Member Avatar for kehar
0
159
Member Avatar for azjherben

Rather then do that, how about going with Worker Threads and I/O completion ports! Very lightweight and you can associate a socket with a user value so since few threads are handling a multitude of sockets, the user value (an index) can be used to connect the traffic to the …

Member Avatar for Nick Evan
0
188
Member Avatar for _dragonwolf_

You have to perform analysis on the data pertinent to an individual after you've processed everyone in the file which means you need to store the information. Run the list once to find out how many there are! rewind create structure array to store the students. One structure each student. …

Member Avatar for jephthah
0
123
Member Avatar for Whilliam

Exactly as csurfer said. You're trying to traverse your linked list but you're also overwriting each node from the file read thus invalidating your pointer! Exit your functions upon errors. Don't keep trying to load or save data when you have no file handle!

Member Avatar for csurfer
0
171
Member Avatar for Hiroshe

BOOM? Your indexing count is 10. How big are your input and output arrays?

Member Avatar for Hiroshe
0
202
Member Avatar for dcm882003

Your instructions said print, but you're writing results to a file! Add code tags, clean up, and re-read your instructions.

Member Avatar for dcm882003
0
104
Member Avatar for calef13

Can you add more then that snippet. And add comments! That 80x86 assembler you're using is camouflaging the assembly code making it harder to read due to its abstraction methodology.

Member Avatar for calef13
0
176
Member Avatar for xixpsychoxix

You're reseting the processor so you come up in real mode, you set your CS and DS segment registers and the first thing you do is use the stack in your video interrupt call! Shouldn't you be setting up your stack as well before you use it? (Just a thought!) …

Member Avatar for xixpsychoxix
0
358
Member Avatar for lovley

Grade conversion should be easy. iteration enumeration So each enumeration A through F you can assign to to standard scoring levels? F=0, D=1, C=2, B=3, A=4 And GPA is merely the average. @sum( 0...N-1) / N But you need to fill in all your class requirements first, take a pass …

Member Avatar for VernonDozier
0
246
Member Avatar for Stemack

You are talking about floating point. Dependent upon the data format typically IEEE 32-bit SPFP Single-Precision Floating-Point 64-bit DPFP Double-Precision Floating-Point 80-bit Double-Extended Precision Floating-Point there are three components. A sign bit, typically the MSB. The Exponent and the Mantissa. So 1.0 in 32-bit using IEEE would be 0x3f800000 -1.0 …

Member Avatar for Stemack
0
154
Member Avatar for DeadJustice

So why aren't you using an empty block of stack and filling it with primes so then you only need to divide by earlier resolved primes instead of the entire set of numbers? My mind is a bit tired, but as a rule you should always heavily comment your code. …

Member Avatar for DeadJustice
0
4K
Member Avatar for Hiroshe

[CODE] char *extract(int *pos, char *array) static char output[11] = {0}; int max = (*pos) + 10, count = 0; // Need a terminator detection or will overrun the buffer // on last 10 character run if fewer then 10 chars! while(( 0 != array[*pos] ) && (*pos < max)) …

Member Avatar for Hiroshe
0
142
Member Avatar for sfuo

I haven't looked at your code but when you connected to your friends computer. Were they at your location or somewhere else. If somewhere else is your friends computer acting as the host on a static or dynamic IP. If dynamic then you're out of luck. If static then you …

Member Avatar for sfuo
0
171
Member Avatar for DNDSH

Here's a leg up... Technically [CODE] char ary[] = "Never go down to the whithering woods. The creatures who live there are up to no good. The gnomes are nasty and the trolls are hairy, and the creatures who live there are scary"; [/CODE] That is not a string. That …

Member Avatar for DNDSH
0
273
Member Avatar for fourstar

Use stricmp() Same as strcmp except it's caseless! Though I'd recommend strlwr or strupr to convert to lower and upper case but do a strncmp so that you're only comparing the first 3 letters. That way abbreviation can be used and a match will still work! To save a running …

Member Avatar for fourstar
0
2K
Member Avatar for zeus1216gw

Missing your fact initialization! Also in your code, you need the entire function because a is missing, etc. And why the second loop if it is based upon the outer loop? [CODE] for ( int x = 0; x <= 10; x = x + 1) { int fact = …

Member Avatar for zeus1216gw
0
140
Member Avatar for zeus1216gw

Found your problem on-line. We are to write a program that calculates and displays the probability of 0 to 10 planes attempting to land in any minute period at an airport during peak arrival times. We are supposed to use Poisson probability function. Your answer is posted elsewhere with a …

Member Avatar for tux4life
0
174
Member Avatar for pokerstar

[B]And why are you storing your return address into your address of average? Also in odd_lp you're storing the list entry to the minimum $a2 not the median $a3 as your comment says [/B] [CODE] [B] sw $t2, ($a2) Save minimum #median sw $ra, 8($sp) Save return address?[/B] sw $fp, …

Member Avatar for wildgoose
0
613
Member Avatar for indianjk

Write your algorithm in C first. Once working then in assembly. C is close to assembly without the time consumption necessary to get your program working. Once you have your flow down, then do the assembly. Post your C and your latest attempt at assembly (since you said you've been …

Member Avatar for wildgoose
0
101
Member Avatar for Spagett912

ALWAYS write your function in a highe level language first. Get the algorithms functioning properly. THEN write it in assembly code. Then run both functions and compare the results to validate the assembly! So if using C/C++ write your function in pure C first (NOT C++), then take a pass …

Member Avatar for wildgoose
0
179
Member Avatar for hughesadam_87
Member Avatar for pokerstar

Use a static buffer 256 or so bytes in size. Plenty of room! You can subtract the current add new character position from the buffer base to get your index. Do a modulus operation and advance that many slots by inserting spaces. OR you can have a moving partition. NEXT …

Member Avatar for pokerstar
0
2K
Member Avatar for lotrsimp12345

What are you trying to do? Also you don't need the second if, just else! And your return is hinky! [CODE] return keep_per_end=keep/2; [/CODE] You need to add white space to your equations to make problems more apparent! [CODE] return keep_per_end = keep / 2; [/CODE] I'm not sure what …

Member Avatar for lotrsimp12345
0
145
Member Avatar for IAmCalledDave

"Get a new PSU!" They're cheap!!!! Sorry, I couldn't resist. You will find that the PSU's have mostly non-available components, and they're usually right to the edge of tolerance for cost savings in manufacturing to maximize profits. The cap didn't blow because it felt like it. Typically the circuits being …

Member Avatar for wildgoose
0
154
Member Avatar for serkan sendur

Look for something not properly initialized! Singlestep in the debugger and see if data contains expected values. Other then that, the specific problem or code needs to be shown from view to have better insight!

Member Avatar for serkan sendur
0
87
Member Avatar for salesman91

You're using a slightly modified graph function as to what is posted from atleast one college on-line. Figure out what you want your scale to be, draw your cross ticks and place your coordinates. You're using max limits each call. You should have something like: [CODE] int cx,cy; main() { …

Member Avatar for salesman91
0
107
Member Avatar for sam511

Here you go as in initial pass! But you really need to swap the node links, not the contents of the node. Also you should use a more complex sort then a slow bubble sort! [CODE] void displaysortbyID( void ) { struct school *pre; struct school *move; struct school temp; …

Member Avatar for sam511
0
84
Member Avatar for nahmartin

When one vectorized their code the idea is to have the three or four components processed side by side. Re-examine your loops as you have a problem. They're all exclusive but some are {0...2} and some are {0...3} for XYZ and XYZW processing. Was that intentional? You haven't shown your …

Member Avatar for wildgoose
0
216
Member Avatar for MxDev

I'm really rusty at Java but this may be an architectural thing. Your topic mentions threading but is this event handlr part of the main threads message pump? If so there's your problem. In windowing system such as Windows the primary thread also handles the graphics. Graphical functions are actually …

Member Avatar for MxDev
0
123
Member Avatar for malugirl4

Arrays and Matrices in C are zero based not 1 based! foo[8] uses indexes {0...7} fob[8][3] uses index [0...7][0...2]

Member Avatar for VernonDozier
0
101
Member Avatar for Jintu

Are you using a 32-bit compiler or a 16-bit? If 16-bit then you have a problem! 100000000 is 05f5e100 in hex requiring 32-bits to store. Since you are being signed due to the -1, It seems a Highes score of 32767 would be a more suitable test, IFF you are …

Member Avatar for vegaseat
0
141
Member Avatar for C++ Obliviator

You need to pre-initialize your array as you have gaps that aren't set with valid values! {0...47}, {58...64}, {91...96}

Member Avatar for C++ Obliviator
0
82

The End.