Post has attachment

hello everyone,
i found an interesting iris scanning project on github,(https://github.com/e-radu/irisRec).
i was hoping it would teach me more on image processing and c programming but i cant get it running. can someone please look at it and advice me correctly? or inform me of the necessary changes needed to make it run without errors?

Post has attachment
A pointer references a location in memory and dereferencing a pointer refers to the lookup of the value of the memory location the pointer references. The value of a pointer is a memory address. The C standard does not define the representation of a memory address. This is crucial since not every architecture makes use of the same memory addressing paradigm. Most modern architectures make use of a linear address space or something similar. Still, even this is not precise enough since you might want to talk about physical or virtual addresses. Some architectures make even use of non-numeric addresses. For example, the Symbolics Lisp Machine makes use of tuples of the form (object, offset) as addresses. https://www.viva64.com/en/b/0576/

How can I compare a single value to the whole array. Suppose , I have an array of length of 5 and I want to make a logic which can actually check if the number is already been repeated in the array and display the message of "duplicated value" on the console .It's giving me a tough time, I'm doing this with the loop function.Any help would be appreciated.
I'm a newbie:)

Post has attachment

Post has attachment
I'm new to learning c programming and I'm stuck in a problem, if you guys please help me that'd be much appreciable!
I made a function before the main which converts the decimal to binary but in the end of the function, I set the return value as an array of an integer but when i call the function in the main and run the program it only gives me a first value of my array as as output..
Here is the code!
Photo

Post has attachment
I uploaded a file to FTP server via STOR command and then I closed the data socket. However I found the socket for command is blocked.

// non-block
set_flag(client_data_socket, O_NONBLOCK);
pid_t pid;
if ((pid = fork()) < 0) {
printf("fork error");
continue;
} else if (pid == 0) {
FILE *fp;
if ((fp = fopen(filename, "rb")) == NULL)
{
close(client_data_socket);
printf("open file failed\n");
exit(1);
}
size_t char_size = sizeof(char);
char data_buffer[FILE_READ_BUFFER_SIZE];
int numread;
for (;;)
{
bzero(data_buffer, FILE_READ_BUFFER_SIZE);
numread = fread(data_buffer, char_size, FILE_READ_BUFFER_SIZE, fp);
if (numread < 0)
{
printf("read file failed\n");
break;
}
else if (numread > 0)
{
int length = send(client_data_socket, data_buffer, numread, 0);
if (length == 0)
{
break;
}
else if (length < 0)
{
if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR)
{
continue;
}
printf("[PUT] command send data failed\n");
exit(1);
}
}
if (numread == FILE_READ_BUFFER_SIZE) continue;
else {
break;
}
}
close(client_data_socket);
fclose(fp);
exit(0);
} else {
int status = 0;
waitpid(pid, &status, 0);
if (status == 0)
printf("send file %s complete.\n", filename);
else
printf("send file %s failed.\n", filename);
}
github: https://github.com/salamander-mh/flyf
Photo

Commonly Asked C Programming Interview Questions

1. What are different storage class specifiers in C?
2. What is scope of a variable? How are variables scoped in C?
3. How will you print “Hello World” without semicolon?
4. When should we use pointers in a C program?
5. What is NULL pointer?
6. What is Dangling pointer?

Do you know more? Do you know answer of each basic question? Share your information.

Did Ritchie have some knowledge of Category Theory when developping C ?
There can be no doubt that a struct is a product and a union is a coproduct.
Void is a terminal object. Pointers also have a very functorial feel - as well
as a very lambda-abstraction feel: if you can have pointers to functions of pointers to functions which yield pointers to functions then C is in some aspects a functional programming language (but so are Python (written in C), Javascript...). Somebody on a forum tried to show how you can do OOP in plain C but got told off.

But Robert Love in Linux Kernel Development 3rd Edition writes: p 265 footnote:

People often miss this, or even deny it, but there are many examples of object-oriented programming in the kernel...the VFS(virtual file system) is an example of how to do clean and efficient OOP in C

Any thoughts on this ?



I am wondering where there is an official explanation
of the syntax of function declarations, including functions
which include as arguments pointers to functions and which yield pointers to functions ?

If I wanted to declare a function which takes an integer and yields a
pointer to a function of integers:

void ( *function(int n))(int)

Or a function which takes a pointer to a function of integers and yields an integer:

int function(void (*f)(int))

Or a pointer to a function which takes a pointer to a function of integers and yields an integer

int (*function) ( void (*f)(int))

Is this all correct ?

But what if I wanted a function which takes a pointer to a function of integers and yields a pointer to integers ?

Wait while more posts are being loaded