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
851 views
1 answer
    Is the following well defined? const char not_a_c_string[] = { 'h', 'e', 'l', 'l', 'o' }; printf( " ... where the "%.*s" construct is suggested. 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 model a basic CPU by mmapping a 1 MiB file, corresponding to the RAM size. I want to read/write this ... 1; printf("%i", ram[2]); See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
699 views
1 answer
    Most definitions of restrict say that it's a promise from the programmer to the compiler that for the ... result in undefined behaviour? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.6k views
1 answer
    I need to use fscanf to ignore all the white spaces and to not keep it. I tried to use something like the ... as fgets() but didnt keep it! See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
928 views
1 answer
    Consider this code, which computes the maximum element of an array. #include <stdio.h> int maximum(int arr[], ... block called four (4) times? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    I have two helper functions to break up strings in the format of decimal prices ie. "23.00", "2.30" Consider ... 0; else return atoi(tok); } See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.2k views
1 answer
    When I use chdir() to change the current working directory, why doesn't the getenv("PWD") give the present working ... is "/home/user" "/boot" See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.5k views
1 answer
    Is there is a timeout crossplatform soulution to accept client using accept function without setting socket to non- ... fix that? Thanks! See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
924 views
1 answer
    I'm making a game where the world is divided into chunks of data describing the world. I keep the ... has allocated the requested amount? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
949 views
1 answer
    Is there a gcc flag to signal a warning/error when I try to put a double value into an int variable? I ... even though I'm losing information. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.0k views
1 answer
    I wrote a C program in Linux to set the values of environment variables using setenv, but after execution, when I ... "setenv failed on ENV1"); See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
747 views
1 answer
    I tried to create MAP_GROWSDOWN mapping with the expectation it would grow automatically. As specified in the manual ... mean by growing here? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
874 views
1 answer
    Is there a problem with multiple threads using the same integer memory location between pthreads in a C program ... atomic of operations, right? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
952 views
1 answer
    I have spotted something in C header files what I can't figure out what is for. For example in file bits/ ... google nor this site search box. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.2k views
1 answer
    I am working on a parser to get data from an XML file. I am using libxml2 to extract data. I am a not ... to get the count of the attributes. 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 on Ubuntu 10.04 using GCC and I want to use the macro TEMP_FAILURE_RETRY as described here: http://www ... same #ifdef __USE_GNU in my code? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
854 views
1 answer
    I am using strtod( ) function to extract an environment variable as a string, and then changing it to double ... great help. Thanks in advance. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
912 views
1 answer
    I was trying to write some macros for type safe use of _Bool and then stress test my code. For evil testing ... does not mention _Bool at all. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.3k views
1 answer
    I wrote small kernel module code as mentioned below, I am testing it in ubuntu 14.04 #include <linux/module.h ... module removed [ 4073.324994] See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
794 views
1 answer
    Compiling code 1 gives an error 'i redefined', but code 2 shows no similar error. Why is it so? Code 1 static int ... . int main(){ return 0; } See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
957 views
1 answer
    # include <stdio.h> # include <stdbool.h> # include <string.h> # include <stdlib.h> int main () { ... how much memory is allocated to buffer? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
706 views
1 answer
    An Example Suppose we have a text to write and could be converted to "uppercase or lowercase", and can be ... realize of why OOP was invented. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
888 views
1 answer
    I'm having an array, that has arrays in every cell. For example, the big array is called arr: int a[3] = {3 ... self. So what can I do? Thanks! See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
905 views
1 answer
    I am trying to write a program where i need to monitor ends of unnamed pipe for certain events. ... poll function with functional descriptors See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
932 views
1 answer
    In Chapter 4, paragraph 4.3 of Steven's "The Socket: Networking API, Third Edition", the author states the ... flow resumed on the same socket. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
928 views
1 answer
    I can't find any information regarding what sorting algorithm C qsort function uses. Is it quicksort? It is not mentioned in man. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
918 views
1 answer
    I'm learning to write kernel modules for linux as a beginner. What I'm trying to do is to write every task ... Anyone knows how to fix this ?? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
823 views
1 answer
    I'm having trouble understanding the output of this program int main() { double x = 1.8939201459282359e-308; double y = ... from x + 2.0*y? 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

...