Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

Recent questions tagged c

0 votes
468 views
1 answer
    Like so: if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) { ... Though I've read man fcntl, I can't figure out what it does. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
392 views
1 answer
    I read in multiple places that the default buffer size for a pipe is 4kB (for instance, here), and my ulimit ... 64k! What is happening here?? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
258 views
1 answer
    Am I correct in thinking that: char *buff[500]; ... creates a stack variable, and: char *buff = (char * ... function a stack frame on the stack? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
273 views
1 answer
    I'd like to do something like printf("?", count, char) to repeat a character count times. What is the right ... is just what I wanted to avoid. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
302 views
1 answer
    I have a multi-threaded server (thread pool) that is handling a large number of requests (up to ... inappropriately by multiple threads. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
311 views
1 answer
    What basically __asm__ __volatile__ () does and what is significance of "memory" for ARM architecture? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
438 views
1 answer
    I am attempting to bind a socket to a port below: if( bind(socket_desc,(struct sockaddr *) &server, sizeof( ... use Why does this error occur? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
593 views
1 answer
    I read that strcpy is for copying a string, and strdup returns a pointer to a new string to duplicate the ... do you prefer to use strdup? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
552 views
1 answer
    Using gcc and ld on x86_64 linux I need to link against a newer version of a library (glibc 2.14) but ... which might be useful sometimes too. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
808 views
1 answer
    I'm experimenting to learn flex and would like to match string literals. My code currently looks like: """ ... with flex. Please advise! See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
310 views
1 answer
    I was confused with usage of %c and %s in the following C program #include <stdio.h> void main() { char name[] ... argument 2 has type char *' See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
376 views
1 answer
    I have a third-party library which consists mainly of a large number of static (.a) library files. I can compile ... into a single .so file? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
320 views
1 answer
    If I have a struct like this: typedef struct { unsigned char c1; unsigned char c2; } myStruct; What would be the ... ? myStruct _m2 = {0,0}; See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
489 views
1 answer
    I have a FILE *, returned by a call to fopen(). I need to get a file descriptor from it, to make ... a file descriptor from a file pointer? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
233 views
1 answer
    So I am trying to measure the latencies of L1, L2, L3 cache using C. I know the size of them and I feel I ... 0 0 0 0 1 0 0 clock_gettime(CLOCK_REALTIME, &endAccess); //e...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
485 views
1 answer
    In trying to build a very latency sensitive application, that needs to send 100s of messages a seconds, ... 62 nanoseconds gettimeofday takes See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
432 views
1 answer
    I am working on a school project where I had to write a multi-threaded server, and now I am comparing it to ... to help. Any way around this? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
274 views
1 answer
    This is an excerpt from the book on C by Kernighan and Ritchie. It shows how to implement a version of malloc. Although ... = bp; freep = p; } See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
277 views
1 answer
    I am just now learning about function pointers and, as I was reading the K&R chapter on the subject, the first ... the two so closely. Thanks. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
318 views
1 answer
    In a project, somebody pushed this line: double (*e)[n+1] = malloc((n+1) * sizeof(*e)); Which ... we'd use something we actually understand. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
354 views
1 answer
    What is the difference between memmove and memcpy? Which one do you usually use and how? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
313 views
1 answer
    I want to blur my image using the native Gaussian blur formula. I read the Wikipedia article, but I am not ... in functions like what MATLAB has See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
227 views
1 answer
    Earlier I had assumed that : Platform driver is for those devices that are on chip. Normal device driver ... devices. Please somebody explain. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
359 views
1 answer
    I am on CentOS 6.4 32 bit and am trying to cause a buffer overflow in a program. Within GDB it works. Here ... it seg faults. Why might this be? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
409 views
1 answer
    Can anyone explain in simple English about the differences between printf, fprintf, and sprintf with examples? What ... File Handling in C". See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
384 views
1 answer
    How can I print all global variables/local variables? Is that possible in gdb? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
486 views
1 answer
    I'm working on a mailbox project, and I have these two structures: struct mmbox_mail struct mmbox_mail { char * ... , one inside one other. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
548 views
1 answer
    I am getting a segmentation fault in my C code when trying to read integer input from the user with the following ... ) from /lib64/libc.so.6 See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
Ask a question:
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...