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
453 views
1 answer
    I get an error when using the pow function -nan(ind) prints to the screen. Wondering if theres a way to use pow ... printf("%lf ", sum); } } See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
292 views
1 answer
    whenever i use a function which is called in main function, it gives this error: Call to undefined function in function main( ... "%d ", m ) ; } See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
270 views
1 answer
    I'm reading this tutorial about debugging. I pasted the factorial code in my .c archive: #include <stdio.h> ... , instead of a garbage value? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
404 views
1 answer
    Example code: int main () { char b[] = {"abcd"}; char *c = NULL; printf(" size: %d ",sizeof(b)); ... write and sometimes do not get a core dump? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
383 views
1 answer
    From the man page: The strcmp() and strncmp() functions return an integer less than, equal to, or greater ... documented behavior is bad style. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
281 views
1 answer
    Any ideas why it works fine for values like 0, 1, 2, 3, 4... and seg faults for values like > ... ; return returnMinusOne + returnMinustwo; } } See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
900 views
1 answer
    On some embedded device, I have passed an unsigned char pointer to atoi without a cast. unsigned char c[10]= ... also ok to unsigned char? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
295 views
1 answer
    I have a parameter num of int type, where the user can give it one of two values: 0 or 1. I can check ... faster way to run this check. Thanks See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
437 views
1 answer
    The following piece of code behaves differently in 32-bit and 64-bit operating systems. char *cat = "v,a"; if ... 64-bit OS are Linux (Fedora). See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
278 views
1 answer
    Yes, I know it sounds silly but i have no idea what i'm doing wrong! The function is part of a poker game, in ... (c2)); px = 8; } } See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
360 views
1 answer
    I'm working on a program that is using a pipe and forks and need to change the write end to an output file. But ... is 0? Or how to fix it? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
320 views
1 answer
    In sed source I saw often func(...) int b; char c; { ... } Why put variables there? Does it ... 57 reg_errcode_t ret; 58 int init_buf_len; 59 See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
357 views
1 answer
    I'm taking a C refresher and took on a board game as an exercise. The board game is "Game of the Generals" ... ,rand_x,rand_y); } } } } See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
493 views
1 answer
    I've been wondering if it's possible to compile using GCC with some optimization flag to avoid have two ... uses the same memory addresses? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
297 views
1 answer
    I have a parent process which forks out a child to perform execv(). I need the output given by execv() to ... file, without using pipes or tees? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
317 views
1 answer
    int i = 0; int min = x[i]; while ( i < n ){ if ( x[i] < min ){ min = x[i]; } i++ ... like to write a function that with recursion. Please help! See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
257 views
1 answer
    I'm familiar with data alignment and performance but I'm rather new to aligning code. I started programming in x86-64 ... 5e: c3 ret 5f: 90 nop See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
420 views
1 answer
    Consider following code: // hacky, since "123" is 4 chars long (including terminating 0) char symbols[3] ... explicitly defined in C standard. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
576 views
1 answer
    I have the following error when compiling a C file: t_memmove.c: In function ft_memmove': ft_memmove.c:19: ... does this error come up? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
342 views
1 answer
    In this golfing answer I saw a trick where the return value is the second parameter which is not passed in. ... of different versions of GCC. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
411 views
1 answer
    I've recently got into some pieces of code doing some questionable 2D arrays indexing operations. Considering ... to undefined behavior? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
318 views
1 answer
    Consider the following code: #include <stdio.h> void foo() { printf("Hello world "); } void bar() { ... there is another explanation of this? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
418 views
1 answer
    Often and often I felt some of the parentheses around arguments in macro definitions were redundant. It's too ... ! Parenthesize them all! TnT See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
437 views
1 answer
    I got a problem of linking an OpenSSL library into an existing project. Where I do get it wrong? ... undefined reference to `EVP_idea_cbc' See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
708 views
1 answer
    I am new to bits, I am trying to get 64 bit value send using UDP. int plugin(unsigned char *Buffer) { ... ? Please suggest me a way forward. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
323 views
1 answer
    Can anybody please tell me why this statement is giving an error - Lvalue Required (a>b?g=a:g=b); but ... b are taken as input from keyboard. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
341 views
1 answer
    Given three integers, a, band c with a,b <= c < INT_MAX I need to compute (a * b) % c but a * ... won't overflow for the values in question? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
384 views
1 answer
    Can I assign a pointer to an integer variable? Like the following. int *pointer; int array1[25]; int ... possible to do like this? 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

...