Questions tagged [c99]

This tag is for questions regarding the International Standard ISO 9899:1999, aka "C99", with technical corrigenda, and for questions about code written in C99 (as opposed to K&R C, C89 or later C Standard revisions like the 2011 revision C11).

This tag is for questions regarding the International Standard ISO 9899:1999 , aka "C99", with technical corrigenda, and for questions about code written in C99 (as opposed to K&R C, C89 or later C Standard revisions like the 2011 revision C11).

Always use the tag for all your C questions, then complement it with the tags for questions that are specific to this version of the standard.

1900 questions
0
votes
1 answer

Why I get segmentation fault (core dump)

Hi I don't know why I get the segmentation fault error. I have to, given the pointer to a file (which contains one number per line, like 12232 in the first line and 240 in the second etc..) I have to find and print for each number the cipher that is…
awwww
  • 23
  • 5
0
votes
0 answers

Does newest LCC-win64 support ISO C99 standard math library?

A while back, LCC did not support C99: e.g. if I use math functions, such as "sinf", "acosh", it did not work. I have heard that they have been adding support for C99 in the last few years. Does anyone know whether the latest support C99 ISO? Is…
knightyangpku
  • 75
  • 1
  • 4
0
votes
0 answers

Why i do not get printed the last node of the list?

Hi I cannot understand why I do not get printed the last node of the list (just the LAST time). The first time I'm just printing the list (and everything works), the second I'm going to sum all the previous numbers of a node to that node (and it…
awwww
  • 23
  • 5
0
votes
0 answers

c99 -- expected expression before return

The following recursive function should return 0 if the sum of the provided array is negative, and 1 if the sum is greater than or equal to 0. I don't understand why I get an "error: expected expression before return" when compiling it. int…
awwww
  • 23
  • 5
0
votes
1 answer

Background process in my own shell program to ignore stdin

I'm working on my own little shell program in C. When I run the child process as a background process, I would like to ignore the input from the user coming from the parent process. I am currently trying to pipe it then close stdin for the child,…
0
votes
1 answer

Median filter with RenderScript on Android

I'm taking my first steps into image processing with RenderScript. Now I'm trying to implement a Median filter for Android with it. Basically what I try to do with it is: It gets an image in bitmap format, runs a 3x3 filter for every pixel with…
Alice89
  • 3
  • 1
0
votes
0 answers

Specify number of bits to use for `enum` in C (compile error if a value doesn't fit)

Does not need to be portable. As long as it works for one compiler, I can make an ifdef to enable it only on that compiler. I'd prefer a GCC solution but any compiler is fine. I'm using C99. For context, I'm trying to pack some data together into 32…
CoffeeTableEspresso
  • 2,614
  • 1
  • 12
  • 30
0
votes
1 answer

Checking whether buffers are interleaved - defined behaviour?

Suppose I need a function that checks whether two arbitrary buffers are interleaved*. One straightforward idea that comes to mind would be this: bool isInterleaved(uint* buf1, // pointer to first buffer uint* buf2, // pointer to…
0
votes
1 answer

OpenCL nested loop produces unexpected results

I'm a bit new to OpenCL/C99, but can't understand why the the two kernels below give different results. X has been initialized to zeros, but requires "re-zeroing" at each outer loop step else incorrect results are obtained (see plot). Notice that…
anon01
  • 10,618
  • 8
  • 35
  • 58
0
votes
0 answers

Is Visual Studio 2019 Compatible with C99?

I'm trying to build a C project from a public library I found on GitHub. The header files are spitting out a ton of errors. One of the obvious problems is that it doesn't recognized ellipses in macro definitions. There are threads that indicate…
Quark Soup
  • 4,272
  • 3
  • 42
  • 74
0
votes
1 answer

why segmentation fault error in recursive function

Hi I wrote this code and the aim is to see weather a word is palyndrom or not, I get a segmenation fault while executing, may you help? Is it a good way to see if a word is palyndrom? thx in advance #include #include #include…
yepitis
  • 23
  • 4
0
votes
1 answer

Dynamic arrays and unexpected output

I have written this script, and the aim of it is to get in input a phrase and to print just the first word (the one before the first space). I cannot understand why, when I execute it, I get a bunch of numbers in the output. #include…
yepitis
  • 23
  • 4
0
votes
2 answers

Share variables between functions in C99

Taking in input from the main matrix_1, I need to create a new one and print it with only the odd numbers. Now I'm printing it from the function, but I need to print it from the main(); how can I do that? #include #define len 4 void…
yepitis
  • 23
  • 4
0
votes
1 answer

BackTracking function is not working as expected

I am trying to solve the following question using BackTracking in C but I don't know how to continue from here... The question is: Chris is planning to travel in a country with N cities. He will get help from a matrix NxN that the cell (I,J)…
user12603566
0
votes
1 answer

Implicit declaration of function 'pool' is invalid in C99

The goal of this program is to store a large number of integers in an array as seen below. It uses a "pool" function to gather the integers with an index of 2 and it returns the "pool" to the main function. I tried compiling the code in Xcode 11 but…
Christian
  • 13
  • 2
  • 6