Assuming I have a .ppm image mapped to char *source and I want to invert/rotate it. Can I "directly" copy the value from each pixel struct to the destination mmf?
destination[i]=source[i]
...
Type: Posts; User: CYBERRRR
Assuming I have a .ppm image mapped to char *source and I want to invert/rotate it. Can I "directly" copy the value from each pixel struct to the destination mmf?
destination[i]=source[i]
...
Yep, that did it. I just copy/pasted that part from where I was mapping the original image. Would have never guessed the error was there.
Now it is working, thank you very much! ;)
I'm writing a program that mirrors an image using Memory Mapped Files.
These are the parts of the code I find relevant for this particular error.
First I create the output file.
if ( (fpout...
when I said check I clearly meant I was making a printf to see the value, not checking "if ()".. Thanks
The line after those two in red checks it :p
The error is bad file descriptor, I'm guessing something related to closing the socket is wrong, but I don't see where else I should put it..
A...
I haven't finished the program yet, I usually put that stuff at the final stages. I am checking the read values when reading from the buffer, didn't you see?
Yes, when it fails sometimes I get "-1"...
server.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <pthread.h>
#include <time.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/types.h>
host_lookup() returns a string containing an ip address.. its max length will be 15. find's size is 50. there's enough space.
concerning the strlen() stuff, I have already zeroed the find string...
One of you has to know the answer...
I've been serching on this topic for a while, both on google and here. I've read "Beej's Guide to Network Programming" as someone here sugested and the FAQ section about sockets where Hammer talks...