c
Waiting on multiple semaphores without busy-waiting (C/C++ Linux)
If I have more than one semaphore, how can I have a process block until at least one of the semaphores is free? I know I can do this with a busy-wait loop such as:[详细]
2023-04-13 01:38 分类:问答Is it possible to print out only a certain section of a C-string, without making a separate substring?
Say I have the following: char* string = \"Hello, how are you?\"; Is it possible to print out only the last 5 bytes of this string? What about the f开发者_如何学JAVAirst 5 bytes only? Is there some[详细]
2023-04-13 01:36 分类:问答Library for maintaining on-disk cache [closed]
Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines. It is not currently accepting answers.[详细]
2023-04-13 01:28 分类:问答When to use printf/scanf vs cout/cin?
I\'m testing some snippets I found off the web using g++ from MinGW.This is the C++ compiler...why then does it correctly compile C....why do p开发者_StackOverflow中文版eople intertwine C and C++.[详细]
2023-04-13 01:23 分类:问答C code for reading numbers from a file
I want to read all integers from a file and put them all in an array ./prog input.txt where input.txt contains for example the following numbers[详细]
2023-04-13 00:51 分类:问答double-dash command line options instead of getopt
How can I accept a command line argument this way: ./a.out --printall so that inside my program, I have something like[详细]
2023-04-13 00:45 分类:问答How do i check for numeric value in C language?
This question has been asked before, but i\'ve never found a clear and simple answer, so i\'m asking it again...[详细]
2023-04-13 00:43 分类:问答How to set the 513th bit of a char[1024] in C?
I was recently asked in an in开发者_StackOverflow社区terview how to set the 513th bit of a char[1024] in C, but I\'m unsure how to approach the problem. I saw How do you set, clear, and toggle a singl[详细]
2023-04-13 00:38 分类:问答Coding/configuring an OpenSSL server for maximum compatibility
I am coding an SSL server in C + 开发者_如何学运维OpenSSL. This is pretty straightforward, and there are lots of examples to follow.[详细]
2023-04-13 00:24 分类:问答How to simplify a fraction
I want to simplify a fraction in my application. The fraction is like, x/y where x and y are integers.[详细]
2023-04-13 00:17 分类:问答