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
812 views
1 answer
    I use realloc to resize the memory allocated: char **get_channel_name(void) { char **result; int n; result = ... these 2 possible memory leaks? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
558 views
1 answer
    The following compiles and prints "string" as an output. #include <stdio.h> struct S { int x; char c[7]; }; ... point". What's going on here? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
728 views
1 answer
    How would I go about converting a X509 certificate in C into human readable string. For example: X509* cert; into - ... ----END CERTIFICATE----- See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    Using -Wall -pedantic #include <limits.h> #include <stdio.h> int main(void) { enum x { a, max = INT_MAX ... value is unknown at compile time? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
877 views
1 answer
    I'm trying to use dladdr. It correctly locates the library, but it does not find the function name. I can ... have anything to do with elf. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    i've written two simple programs: int main(int ac, char **argv ) { execv( "/home/me/Desktop/execvtest2", ... Am I doing something wrong? Cheers See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
863 views
1 answer
    I used this code to read file. But fread function always return 0. What is my mistake? FILE *file = fopen( ... file); } } fclose(file); See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
607 views
1 answer
    I am reading Microsoft's CRT source code, and I can come up with the following code, where the function __initstdio1 will ... ! "); return 0; } See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
737 views
1 answer
    Given two absolute paths, e.g. /a/path/to/a /a/path/to/somewhere/else How can I get a relative path ... , the opposite of what realpath does. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
823 views
1 answer
    I'm trying to compile a kernel module (which I wrote myself) on a raspberry pi. I am compiling it in the ... if one wants to compile for ARM? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
567 views
1 answer
    When I do math computation in Python which library are we using. E.g. >>> 2**0.5 1.4142135623730951 How can ... *(t1+t2) */ GET_FLOAT_WORD(is,y); SET_FLOAT_WORD(y1,is&0xfffff000);...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
806 views
1 answer
    Can anyone tell me how to implement Sieve of Eratosthenes algorithm in C? I need to generate prime numbers but my ... prime are to be printed. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
730 views
1 answer
    I've heard that the 128-bit integer data-types like __int128_t provided by GCC are emulated and therefore slow. ... SSE instructions (if any)? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
996 views
1 answer
    static char buf[8]; void foo(){ const char* ptr = buf; /* ... */ char* q = (char*)ptr; } The ... and one non-const) seems like a worse idea. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
613 views
1 answer
    Why is this C program giving the "wrong" output? #include<stdio.h> void main() { float f = 12345.054321; printf( ... I am using VC++ in VS2008. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
713 views
1 answer
    I just happened to look at the prototype of the printf (and other fprintf class of functions) - int printf( ... the format argument of printf? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
762 views
1 answer
    I'm trying to write a size function like this: size(void *p,int size); Which would return the size of an array ... but I'm doing it for fun. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
843 views
1 answer
    main() { unsigned x = 1; char y = -1; if (x > y) printf("x>y"); else printf("x<=y"); } ... int to signed int to get the expected result. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
660 views
1 answer
    I have the following example #include <stdlib.h> #include <stdio.h> #include <stddef.h> typedef struct test{ int a; ... ? I'm using C11 N1570. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.5k views
1 answer
    I would like to create a semi transparent white window in XLib, but the window is not semi translucent, it remains ... (display); return 0; } See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
758 views
1 answer
    I get this error in a C header file in this line : char * getFechaHora(time_t & tiempoPuro); In a C source ... correctly the "time.h" library. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
542 views
1 answer
    Is there a way to instruct GCC (I'm using 4.8.4) to unroll the while loop in the bottom function ... high performance, yet portable library. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.0k views
1 answer
    I keep getting a lot of 'assignment from incompatible pointer type' warnings, and I haven't a clue as to ... ; int lastRef; } myPageFrame; See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
833 views
1 answer
    I've embedded Lua into my C application, and am trying to figure out why a table created in my C code via: ... 't seen this done anywhere.... See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.0k views
1 answer
    I'm trying to write a C function using OpenSSL/libcrypto to calculate the SHA256 sum of a file. I'm basing my ... what I'm doing wrong? Thanks! See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
887 views
1 answer
    I've read that C89 does not support variable-length arrays, but the following experiment seems to disprove that: #include ... am I missing? :-) See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
688 views
1 answer
    I am having trouble aligning memory for DMA transfer on the Cell processor. I need the last 4 bits of an ... = 0xXXXXXXX0 d[1] = 0xXXXXXXX0 See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
841 views
1 answer
    I'm trying to compile a kernel module on kernel 3.13 and I get this error: error: implicit declaration ... eventually fix the problem. Thanks See Question&Answers more detail:os...
asked Oct 24, 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

...