I guess since rand() and srand() isn't very thread safe, or needing to use locks for them i decided to use a simple RNG.
I made a function for each thread. Each function been a pseudorandom number...
Type: Posts; User: st00ch
I guess since rand() and srand() isn't very thread safe, or needing to use locks for them i decided to use a simple RNG.
I made a function for each thread. Each function been a pseudorandom number...
clock() is a good idea.
trying to seed srand() with the result of clock().
seem right?
not exactly getting the desired result. all random numbers are the same. but I think i'm closer.
...
Hi all,
I've wrote this code to generate 8 random numbers. i'll get each core to generate one random number each.
I'm using the OpenMP extension of the GCC compiler here for the code to enable...
Hi all,
I've got a function that I'd like to move into a header file. When i do move the function "Reset_Game()" it gives errors of undeclared variables. which is obvious. but i just don't know...
I've simplified the function a bit and using fgets.
looking at case 6 in the function.
I'm reading integers from a file. fgets first argument 'store', my compiler doesn't like it been an integer,...
Alright, i've fixed the function. Added the code to check if the file can actually be loaded, if not then prints error message.
and got rid of fseek since i'm not using a binary file.
Would i...
Hi all,
I wrote a function to handle file input/output.
when reading from file using the function "File_IPOP(6,0)" fscanf does not want to read the next line in the file. why?
...
Hi all,
The code below I've compiled with GCC using cygwin.
when running the program you can input the size (N) of the latin square to find. IE: N*N
I can generate n=2 (2 by 2) squares and n=3...
ok i've taken the suggestions in and changed the code.
i got the scrap book out and wrote down a flow diagram and then worked out the the code, adding the square root idea and incrementing by 2 idea...
Thanks Salem. wordpad does recognize the \n.
I'm using cygwin installed on windows 7. gcc compiler.
I just wrote the program as a test to see what was going on.
yes it does output "0123" if the input max value is 4.
i'm looking at making newlines between the digits so it will output as
0...
Simple question. why isn't "\n" not working.
#include<stdio.h>
main()
{
int x,max;
Hi all, I'm looking to generate prime numbers. the code starts with p=5, 'p' been a possible prime, then 'd' been the divisor of 'p' to check if it is a prime number or not. where 'x' just increments...