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
652 views
1 answer
    I have declared a struct, and I try to pass an array of those structs (as well as a double array of doubles, ... ], but I get the same thing. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
529 views
1 answer
    #define SIZE 9 int number=5; char letters[SIZE]; /* this wont be null-terminated */ ... char fmt_string[20]; ... there a better way to do this? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
500 views
1 answer
    I am getting a really odd error from GCC 4.8.1 with inline functions. I have two near-identical inline ... headers (i.e. not prototyped) See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
449 views
1 answer
    Besides the LD_PRELOAD trick , and Linux Kernel Modules that replace a certain syscall with one provided by you , ... reaches the actual open ? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
317 views
1 answer
    I am writing a utility which accepts either a filename, or reads from stdin. I would like to know the most robust ... | myprog Size of stdin: -1 See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
674 views
1 answer
    Is there a way in C to parse a piece of text and obtain values for argv and argc, as if the text had ... don't care about quoting of arguments. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
340 views
1 answer
    I am trying to return pointer from a function. But I am getting segmentation fault. Someone please tell what is ... point=12; return point; } See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
446 views
1 answer
    Given a convex polygon, how do I find the 3 points that define a triangle with the greatest area. Related: ... bounding circle of the polygon? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
602 views
1 answer
    I'm implementing piping on a simulated file system in C++ (with mostly C). It needs to run commands in the ... 'r+' for reading and writing. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
442 views
1 answer
    When converting an int like so: char a[256]; sprintf(a, "%d", 132); what's the best way to determine ... way of determining that on the fly? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
384 views
1 answer
    I'm trying to implement malloc and free for C, and I am not sure how to reuse memory. I currently have a ... of confused how to implement this. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
313 views
1 answer
    Do you have any horror stories to tell? The GCC Manual recently added a warning regarding -fstrict-aliasing and ... rules for the example here. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
342 views
1 answer
    Is there some overhead of using variable-length arrays? Could the size of array be passed via command line ... dynamically allocating an array? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
447 views
1 answer
    Systems demand that certain primitives be aligned to certain points within the memory (ints to bytes that are ... which I am oblivious). See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
566 views
1 answer
    Is snprintf always null terminating the destination buffer? In other words, is this sufficient: char dst[10]; ... is not standard behavior. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
414 views
1 answer
    I've seen this unsigned "typeless" type used a couple of times, but never seen an explanation for it. I ... , or just a compiler extension? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
393 views
1 answer
    If I use malloc in my code: int *x = malloc(sizeof(int)); I get this warning from gcc: new.c:7 ... declaration of built-in function malloc' See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
366 views
1 answer
    How can I print a non-null-terminated string using printf, assuming that I know the length of the string at runtime? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
263 views
1 answer
    How can I calculate the time complexity of a recursive algorithm? int pow1(int x,int n) { if(n==0){ return 1; } else ... n/2) return p * p; } } See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
310 views
1 answer
    Consider this simple code: int myvar = 0; int main() { if (fork()>0) { myvar++; } else { // ... value shared with the father (like pthread)? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.0k views
1 answer
    I am trying to print an uint16_t and uint32_t value, but it is not giving the desired output. #include <stdio. ... will be the desired output? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
861 views
1 answer
    This might sound like an interview question but is actually a practical problem. I am working with an embedded ... macros for numerous reasons. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
324 views
1 answer
    I have a file descriptor stored in a variable say var. How can I check whether that descriptor is valid at a later ... . Any API's for that ? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
265 views
1 answer
    I am trying to create an array of strings in C using malloc. The number of strings that the array will hold can ... ], string2); /* etc */ See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
656 views
1 answer
    In a book that I'm reading, it's written that printf with a single argument (without conversion specifiers ... . What are these vulnerabilities? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
364 views
1 answer
    I know you can get the first byte by using int x = number & ((1<<8)-1); or int x = number & 0xFF; But ... be 4 and the last two would be 0. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
291 views
1 answer
    I'm reading The C Programming Language and have understood everything so far. However when I came across the ... book and become more confused. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
715 views
1 answer
    I was trying to figure out the fastest way to do matrix multiplication and tried 3 different ways: Pure python ... it is kind of obvious. 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

...