Search:

Type: Posts; User: st00ch

Search: Search took 0.01 seconds.

  1. Replies
    8
    Views
    7,026

    I guess since rand() and srand() isn't very...

    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...
  2. Replies
    8
    Views
    7,026

    clock() is a good idea. trying to seed srand()...

    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.

    ...
  3. Replies
    8
    Views
    7,026

    Using srand() in multicore code.

    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...
  4. Replies
    1
    Views
    855

    Creating Header file

    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...
  5. I've simplified the function a bit and using...

    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,...
  6. Alright, i've fixed the function. Added the code...

    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...
  7. Not reading the next line down in a text file.

    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?

    ...
  8. Latin Square Generator. Code won't keep looping.

    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...
  9. Replies
    21
    Views
    4,837

    ok i've taken the suggestions in and changed the...

    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...
  10. Thread: newline

    by st00ch
    Replies
    6
    Views
    1,333

    Thanks Salem. wordpad does recognize the \n. ...

    Thanks Salem. wordpad does recognize the \n.

    I'm using cygwin installed on windows 7. gcc compiler.
  11. Thread: newline

    by st00ch
    Replies
    6
    Views
    1,333

    I just wrote the program as a test to see what...

    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...
  12. Thread: newline

    by st00ch
    Replies
    6
    Views
    1,333

    newline

    Simple question. why isn't "\n" not working.


    #include<stdio.h>

    main()

    {

    int x,max;
  13. Replies
    21
    Views
    4,837

    Prime number generator

    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...
Results 1 to 13 of 13