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
Type: Posts; User: AKalair
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
Sorry, stupid mistake.
mmap isn't returning MAP_FAILED
I have
if( ptr = MAP_FAILED )
{
fprintf(stderr, "Error setting shared memory in recordTotalBytes() error is %d \n ", errno);
exit(EXIT_FAILURE);
}
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...
Just checked it against MAP_FAILED
And it IS failing.
Any idea why ?
Thanks
Hi
Thanks for the replies
I changed it to
*ptr = 10
and it still segfaults
Hi,
My code is segment faulting on line 50 (*ptr = 10)
I can't understand why, could someone explain ?
(Headers here)
Cheers guys, it works now :D
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...
Thank You :)
That fixed it i'll bookmark that site
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...
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;
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
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...
I cant compile it either if I change them to main.
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...
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?
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...
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...
^
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...
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,...
Thanks for the help guys I appreciate it.
:)
This is my final program
#include <stdio.h>
Sorry I see the mistake now no &sign before the a. :)
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...
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.
...