rofl
Type: Posts; User: pantherman34
rofl
thanks for the info. also - how would i implement that if the program finds a preprocessor directive, (ie. #define) it disregards all the code on that line after the #define, but includes it with...
UPDATE: i need help! i need to be able to recognize comments that begin with /* and read the whole comment until it ends with */ which spreads multiple lines of code. It needs to be recognized as a...
Can anyone tell me why my program: once it is executed, runs down the screen and it doesnt let me scroll up!!! no idea why its doing this. very frustrating. i tried changing with my properties on my...
How would i go about executing a program from a command prompt with the input file name and output file name as command line arguments? forexample if my program is named "program" the command i need...
you have a point. it should probably be 1:1. The code works fine for me.
here is up'd code. i am getting the equal amount of reads as to writes....since i have 4 read threads and only 1 write thread....shouldnt i be getting 4x more reads than writes?!
#include...
i updated the code above. for one, the writer is supposed to write something. its in red. im not sure what to do there. and the reader is supposed to read, and im not sure what to do there either. it...
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <semaphore.h>
#define NWRITER 2 /* total number of producers - 1 */
#define NREADER 5 /* total number of consumers - 1 */...
Well actually, i have it working now, and it is giving expected results. the ratio isnt working though (dont know why, its very simple unless i have something wrong). it keeps giving me a ratio of 0....
ha yea i caught that mistype in the debug, i thought it was just a warning. and no not in a hurry, just ready to get it finished!
thank you all. everything is working perfectly!
Ok. Here is new code, it was just easier to start over. I am not confused over the "idea" of this producer/consumer problem, but im still confused about threads and semaphores and stuff. this...
that is very useful, thanks for the info. this is what it said
$ gdb ./a.exe
GNU gdb 6.8.0.20080328-cvs (cygwin-special)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+:...
When you say "instance name" what is that?
Edit** new code in post 4
ok i have the entire code working. there is one last thing i need to do. i must use a typedef as a data record in my headerfile to gather and report performace data (the comparisons and swaps). ive...
ok. the do statement works well. its just one thing - whenever the search runs again...i need the comparisons to set back to zero. the way it is now, the comparisons add together.
do
{
/*...
now its working! do you think there is a better way to get the increments for the linear search? i dont believe it is producing the correct result...and how could i go about continually prompting the...
whenever i apply the * to comparisons in the function...the program runs but it always gets an "unexpected error".
and do all the comparison variables in the funcitons need a * to?
because...
o yes, you are correct! i have the locations returning to main fine, the only problem im having now is getting the comparisons to return correctly via parameters.
prototypes
int sortarray...
ok here is the new code. are my increments in the right place to compute all the bcomparisons? im getting a very large number, and it should be around 100 or less than that i think. The location(mid)...
i have here a binary search. I am trying to get the value of the number of comparisons and swaps performed and having problems with it. All my code is in 3 different files (a requirement). I must...
yes its a requirement to have all these files. how would i use an ide? im using visual studio
EDIT*** i must be becoming better at programming, because i have it working!!! lol
i do need the pointer to sort the same array different ways... but first i want to get this sort working.
Im having problems linking it all together...my program is in different files...
here...