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
880 views
1 answer
    I have been profiling a C code and to do so I compiled with -p and -g flags. So I was wandering what do ... do they add to the binary? Thanks See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
862 views
1 answer
    Tried following code to check what happens when we convert integer pointer to a integer . #include<stdio.h> ... topic would also be helpful. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
795 views
1 answer
    According to this reddit comment thread, it is undefined if an attempt is made to read memory before it has been ... more light on this issue. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
828 views
1 answer
    If a file is opened using the following command: FILE *f1=fopen("test.dat","a+"); The man page reads: a+ ... one for read & another for write? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
715 views
1 answer
    The standard is clear: when performing arithmetic on an integral type smaller than int, the integer is first ... opinion-based" speculation. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
868 views
1 answer
    I'm writing a program in C on windows that needs to run as many threads as available cores. But I dont know ... the number of cores. Any ideas? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
709 views
1 answer
    Here is the structure declare code. struct list_el { int val; struct list_el * next; }; typedef struct list_el item ... code can't be compiled? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
752 views
1 answer
    If I have a function like this: void bla(int size) { while(b){ char tmp[size]; ...... } } tmp gets ... at end of scope or at end of function? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
869 views
1 answer
    I just learned about function pointers (pointers pointing at the adress where where the machine code of a function is ... or am I way off? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
983 views
1 answer
    I have a problem while using the printf function to print values of type unsigned long long int I have no idea ... Could you explain it to me? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
774 views
1 answer
    I found the code below in https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/atomic.h static ... it necessary to do so? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
767 views
1 answer
    I understand that gcc has an option -Wcast-align which warns whenever a pointer is cast such that the required ... 'm compiling it for x86? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
962 views
1 answer
    I use a debugging script that runs several related processes in succession with the debugger. I'm currently using ... if level >= WARNING See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
918 views
1 answer
    I'm writing a program that reads input from stdin, manipulates the input, and writes output to stdout. However, ... something I'm looking for. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
726 views
1 answer
    int a[] = {1, 2 ,3}; I understand that array names are converted to pointers. A term often used is ... memory or it's an implicit conversion? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.2k views
1 answer
    I'm wondering if there is a reason between two exec functions differing in const-ness, of if this is just a ... do either of the above changes. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
865 views
1 answer
    #include <stdio.h> int main(void) { int i; scanf("%d", &i); if(i != 30) { return(0); } printf("i ... .3.1), or on the Godbolt Compiler Explorer) See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
850 views
1 answer
    I'm looking to for a reasonably efficient way of determining if a floating point value (double) can be ... representable as a long? Thanks See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
981 views
1 answer
    It seems that strtol() and strtod() effectively allow (and force) you to cast away constness in a string: ... ) Isn't that really dangerous? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
833 views
1 answer
    Is using an uninitialized variable as the src for memcpy undefined behaviour in C? void foo(int *to) { int from; ... , &from, sizeof(from)); } See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
922 views
1 answer
    I wonder if this yields in undefined behaviour: printf("Test %d %s", 123, "abc", "def", "ghi"); The first ... should be no UB. Is this correct? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
690 views
1 answer
    Will a void* always have the same representation as a char* ? Details: I want to work with a variadic function that ... my variadic(char*,...)? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
811 views
1 answer
    I'm trying to compute 1.34 *sqrt(lght) in this function using inline assembly but I'm getting errors like: ' ... using Ubuntu so GCC, 32 bits See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
797 views
1 answer
    I Learned About 2's Complement and unsigned and signed int. So I Decided to test my knowledge , as far ... not find a satisfactory solution. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
975 views
1 answer
    I'm learning C from CS50. When I run my code, it says 'signed integer overflow'. #include <stdio.h> ... Can someone explain what that means? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
866 views
1 answer
    I wrote this piece of code and was expecting a segmentation fault quicly, but it seems I am allowed to access ... anything... Thanks, bests. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
725 views
1 answer
    I wrote the following Code. #include<stdio.h> int main() { int x = 1 ; int *j = &x ; int y ... pointer value as suggested by Keith Thompson. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
974 views
1 answer
    int age; char name[10]; scanf("%d", &age); scanf("%s", name); In first scanf function we use '&' symbol ... . Can anybody tell me why is so? 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

...