Welcome to Jonic Developer 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
153 views
1 answer
    I seem to be having a problem with my sockets. Below, you will see some code which forks a server and a client. The server opens a TCP socket, and the ... ", clientstatus, serverstatus ); } } return 0; } See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
228 views
1 answer
    Consider this code snippet: pid_t cpid = fork(); if (cpid == -1) { perror("fork"); exit(EXIT_FAILURE); } if (cpid == 0) { // in child execvp( ... process if execvp returns? Shall I use exit() or _exit()? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
165 views
1 answer
    This question isn't terribly specific; it's really for my own C enrichment and I hope others can find it useful as well. Disclaimer: I know many ... would be great). Would this screw up static analyzers? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
295 views
1 answer
    I've been trying to figure out how the fork-exec mechanism is used inside Linux. Everything was going on according to the plan until some web pages ... whole day on this... Thanks for any clarification. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
297 views
1 answer
    In UNIX systems we know malloc() is a non-reentrant function (system call). Why is that? Similarly, printf() also is said to be non- ... to these functions. What prevents them being guaranteed reentrant? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
128 views
1 answer
    Often I find the need to write functions which return function pointers. Whenever I do, the basic format I use is: typedef int (*function_type)(int ... functions and therefore seem redundant in the code. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
203 views
1 answer
    I have a multithreaded C program, which consistently generates a segmentation fault at a specific point in the program. When I run it with gdb, no fault is ... being able to use it to find the problem! See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
302 views
1 answer
    I have two gcc compilers installed on my system, one is gcc 4.1.2 (default) and the other is gcc 4.4.4. How can I check the libc version used by ... used by gcc 4.1.2, since it is the default compiler. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
340 views
1 answer
    What is the difference between atol() & strtol()? According to their man pages, they seem to have the same effect as well as matching arguments: ... have decimal numbers), which function should I use? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
154 views
1 answer
    I've been trying for a couple days to compile a native ARM Android binary that will execute on my phone using a terminal application. I want to generate ... of dynamic binaries, to the libc on the phone. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
165 views
1 answer
    I am new to optimizing code with SSE/SSE2 instructions and until now I have not gotten very far. To my knowledge a common SSE-optimized function would look ... regular C code). Thank you in advance... See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
178 views
1 answer
    I am trying to "mmap" a binary file (~ 8Gb) using the following code (test.c). #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include ... C and system calls. What is wrong with my code? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
174 views
1 answer
    Looking for information regarding the advantages and disadvantages of both fcntl and lockf for file locking. For example which is better to use for ... suited to use for enforcing mutual exclusion. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
217 views
1 answer
    In the following rules for the case when array decays to pointer: An lvalue [see question 2.5] of type array-of-T which appears in an expression ... for a character array"? Some example please. Thanks! See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
115 views
1 answer
    Macros are fine. Templates are fine. Pretty much whatever it works is fine. The example is OpenGL; but the technique is C++ specific and relies on no ... ; and destructor called at end of block? Thanks! See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
356 views
1 answer
    I am facing a serious issue with sprintf. Suppose my code snippet is: sprintf(Buffer,"Hello World"); sprintf(Buffer,"Good Morning"); sprintf(Buffer,"Good ... at the end I want to see all the lines. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
421 views
1 answer
    I have a function that is doing memcpy, but it's taking up an enormous amount of cycles. Is there a faster alternative/approach than using memcpy to move a piece of memory? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
118 views
1 answer
    Not unlike a clap detector ("Clap on! clap clap Clap off! clap clap Clap on, clap off, the Clapper! clap clap ") I need to detect when a ... an adaptive algorithm, and CFAR certainly fits the bill. -Adam See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
335 views
1 answer
    I have the following program #include <stdio.h> int main(void) { unsigned short int length = 10; printf("Enter length : "); scanf("%u", &length); ... I was trying %uh and it was still giving the warning. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
273 views
1 answer
    I've seen programmers use the formula mid = start + (end - start) / 2 instead of using the simpler formula mid = (start + end) / 2 for finding the ... the array or list. Why do they use the former one? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
197 views
1 answer
    In fopen("myfile", "r+") what is the difference between the "r+" and "w+" open mode? I read this: "r" Open a text file for reading. "w" Open a ... I open the file with "w+", the file will be erased first? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
279 views
1 answer
    I've got a full-heap core dump from a dead process on an x86 Linux machine (kernel 2.6.35-22 if it matters), which I'm attempting to debug in GDB. Is ... proc, info mem, info proc seem to do what I need. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
194 views
1 answer
    The Linux specific backtrace() and backtrace_symbols() allows you to produce a call trace of the program. However, it only prints function addresses, not their names ... int main() { foo(); return 0; } See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
682 views
1 answer
    I'm trying to attach a program with gdb but it returns: Attaching to process 29139 Could not attach to process. If your uid matches the uid of the target ... same error. How can I attach it to debuggers? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
214 views
1 answer
    Why does extern int n not compile when n is declared (in a different file) static int n, but works when declared int n? (Both of these declarations were ... extern? If so, what about extern am I missing? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
194 views
1 answer
    I am using Sakamoto's algorithm to find out the day of week from a given date. Can anybody tell me the correctness of this algorithm? I just want this from 2000 to 2099. ... + y/400 + t[m-1] + d) % 7; } See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
426 views
1 answer
    I'm looking for a free copy version of the C89/C90 standard, but I can't find it anywhere! Why is so hard to find it? C99 and C11 standards ... Web searches didn't helped either, nor did Open Standards. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
256 views
1 answer
    I am referring to the POSIX standard select and poll system C API calls. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
To see more, click for the full list of questions or popular tags.
Ask a question:
Welcome to Jonic Developer Community for programmer and developer-Open, Learning and Share
...