Search:

Type: Posts; User: AKalair

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Fixed it ! I wasn't allocating any memory for...

    Fixed it !

    I wasn't allocating any memory for the mutex lock and was passing in &muxlock when it should have just been muxlock


    Not sure why it waited until line 50 to segfault though
  2. Sorry, stupid mistake. mmap isn't returning...

    Sorry, stupid mistake.

    mmap isn't returning MAP_FAILED
  3. I have if( ptr = MAP_FAILED ) {...

    I have



    if( ptr = MAP_FAILED )
    {
    fprintf(stderr, "Error setting shared memory in recordTotalBytes() error is %d \n ", errno);
    exit(EXIT_FAILURE);
    }
  4. The errno is 0 Is that the first entry under...

    The errno is 0

    Is that the first entry under errors on this page?

    mmap

    [EACCES]
    The fildes argument is not open for read, regardless of the protection specified, or fildes is not open for...
  5. Just checked it against MAP_FAILED And it IS...

    Just checked it against MAP_FAILED

    And it IS failing.

    Any idea why ?


    Thanks
  6. Hi Thanks for the replies I changed it to ...

    Hi

    Thanks for the replies

    I changed it to

    *ptr = 10

    and it still segfaults
  7. Segment Fault with shared memory set using mmap

    Hi,

    My code is segment faulting on line 50 (*ptr = 10)

    I can't understand why, could someone explain ?




    (Headers here)
  8. Cheers guys, it works now :D

    Cheers guys, it works now :D
  9. An access violation (segmentation fault) raised in program

    Hi guys,
    I'm on the arrays tutorial and I'm playing around with them. I've wrote the following program to store the input in an array then retrive the 3rd value and display it but when I compile...
  10. Replies
    6
    Views
    1,449

    Thank You :) That fixed it i'll bookmark that...

    Thank You :)

    That fixed it i'll bookmark that site
  11. Replies
    6
    Views
    1,449

    I've changed what it prints but its still the...

    I've changed what it prints but its still the same. I compile it as break.exe and when I run it in a command prompt it simply does nothing and brings back the command prompt input line i.e. C:\Users...
  12. Replies
    6
    Views
    1,449

    Problems with Break in C

    Hi guys,
    I'm learning C and I'm on the break tutorial but when I run this program nothing happens any advice?



    #include <stdio.h>

    int main()
    {
    int option, conversion, pound, dollar;
  13. Replies
    2
    Views
    2,006

    Interacting with USB device

    Hi guys,
    Is there a way to get input from a USB device with C. I want to take the input from my USB capture card and then output it using Winamp or something.



    Thanks
  14. How to get number of processor cycles since start up

    Hi,
    I'm looking to make a random number generator and want to multiply the number generated by the C random number generator by the number of processor cycles there has been since start up. Is...
  15. Replies
    11
    Views
    6,273

    I cant compile it either if I change them to main.

    I cant compile it either if I change them to main.
  16. Replies
    11
    Views
    6,273

    Thanks for the replies guys, Im trying to...

    Thanks for the replies guys,

    Im trying to compile the solution provided to see how it works but I get errors. I think its because im using Dev C++ and maybe its compiling C++ and not C does...
  17. Replies
    11
    Views
    6,273

    Hi, I'll get some code written now. For a 7x6...

    Hi,
    I'll get some code written now. For a 7x6 board is this the right code?



    int boardarry[7][6];



    Also is it four spaces i need to indent my code with?
  18. Replies
    11
    Views
    6,273

    5 In a Row Game

    Hi guys,
    Ive got to do this, this week. http://www.olympiad.org.uk/papers/2004/bio/q2.html

    I'm not to sure on what to do but I've been looking at arrays and come up with this so far.

    I use...
  19. Replies
    1
    Views
    2,312

    Mayan Calander Conversion Issue

    Hi guys,
    I'm doing a past question to practice programming. The question is here: http://www.olympiad.org.uk/papers/2004/bio/q1.html

    Its basically a calender conversion from a Mayan calender...
  20. Replies
    12
    Views
    13,095

    ^ Thanks for the advice guys, I'm not sure why I...

    ^
    Thanks for the advice guys, I'm not sure why I added that part at the start I think it was for the
    while(program!=4) part but ive just tried it without it and it still works so I removed it. Not...
  21. Replies
    12
    Views
    13,095

    Thanks for the replies, I got so caught up in...

    Thanks for the replies, I got so caught up in programming I forgot the Maths and what I was doing lol.



    #include <stdio.h>

    int main ()
    {
    float amount_in_kilos, amount_in_stones,...
  22. Replies
    12
    Views
    13,095

    Thanks for the help guys I appreciate it. :) ...

    Thanks for the help guys I appreciate it.

    :)

    This is my final program



    #include <stdio.h>
  23. Replies
    12
    Views
    13,095

    Sorry I see the mistake now no &sign before the...

    Sorry I see the mistake now no &sign before the a. :)
  24. Replies
    12
    Views
    13,095

    Weight Conversion Program

    Hi guys,
    I started my programming class at college today and the first task is to create a program to convert kilograms to stone and pounds and pounds and stones to kilos. Im working on the first...
  25. Replies
    2
    Views
    782

    Calculator Issue (2293584)

    Hi guys,
    Thanks for the help with my first issue now I have on that I cant even see the logic behind.
    Im attempting to add two numbers and no matter what numbers I put in the answers 2293584.
    ...
Results 1 to 25 of 26
Page 1 of 2 1 2