Questions tagged [c89]

This tag is for questions regarding the international standard ISO 9899:1990, also known as "C89", "C90" or "ANSI C", with amendments and technical corrigenda (as opposed to K&R C, C99, C11 or later C standard revisions).

The first C standard was released 1989 nationally in USA, by their national standard institute ANSI. This release is called C89 or ANSI-C. One year later, the American standard was accepted internationally and published by ISO (ISO 9899:1990). This release is called C90. Technically, it is the same standard as C89/ANSI-C, though formally, C90 replaced C89/ANSI-C, making them obsolete.

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

643 questions
-2
votes
4 answers

Is post-increment operator guaranteed to run instantly?

Let's say I have the following code: int i = 0; func(i++, i++); The increment is happening right after returning the value? Is it guaranteed that the first argument will be 0, and the second argument will be 1?
iTayb
  • 12,373
  • 24
  • 81
  • 135
-2
votes
2 answers

Buffer of function pointers?

I know it may sound sci-fi but I truly want to call a function x times, by using an array of function pointers to it and without involving a loop or anything that may slow down the target program. Is that possible and if yes, how exactly?
DeltaProxy
  • 208
  • 1
  • 2
  • 7
-2
votes
2 answers

The Vigenere encryption

I have written some code, and the Vigenere encryption is used in it. This is a simple program for encrypting/decrypting any files. #include /* LANGUAGE: C. STANDARD: C89. ABOUT PROGRAM: This is a simple program for encrypting/decrypting…
Andrey Bushman
  • 11,712
  • 17
  • 87
  • 182
-3
votes
1 answer

C Program returning an error... google doesn't know

The following code takes an array of integers and create an array with the mobile means (i.e. the value in i-th place is the mean of the last n elements in the array before i (if they exists); if i
-3
votes
1 answer

Why does clang c89 have powf, but gcc c89 doesn't?

Isn't the c89 standard supposed to be consistent ? I'm compiling with gcc -W -Wall -std=c89 -pedantic -O3 On macOS, gcc is an alias of clang it seems : gcc --version returns Apple clang version 14.0.0 (clang-1400.0.29.201). It gives no warnings…
ice-wind
  • 690
  • 4
  • 20
-3
votes
2 answers

How to get a cell value from an array dynamically? [C89]

I have this array : array[0][0] = 1; array[0][1] = 2; array[0][2] = 3; array[0][3] = 4; How could I do something like this ? int a = 0; int b = 1; printf("%d",array[a][b]); C89 is a requirement. Here is a MCVE: int main(int argc, char…
shellwhale
  • 820
  • 1
  • 10
  • 34
-3
votes
1 answer

Coverting a C99 code to C89

I have a code written for VS2015 following C99 standard for building static and dynamic library to be used for other part of a project. I want the libraries to be built for other VS versions as well but need to convert the code into C89 standard. I…
Fahad
  • 1
  • 1
-3
votes
1 answer

Performance difference between C89 and C99

Because C99 allows for things such as VLAs, does this actually cause a measurable performance difference?
Dabloons
  • 1,462
  • 2
  • 17
  • 30
-3
votes
1 answer

Unclear Segmentation Fault returning 139

I try to write a sudoku solver I always get a segmentation fault after calling getPossibleElements in solveSudoku. If I delete this line the error doesnt appear. My Code #include #include #include #define SUDOKU_X…
user547995
  • 2,036
  • 8
  • 33
  • 62
-4
votes
1 answer

What is the difference between ANSI C 89 and C that supports by C++?

I know there are some difference between ANSI C 89 and C that supports by C++. for example in ANSI C 89, you should declare variables at first line of blocks. or when you want to declare struct variables, you should use struct keyword (eg struct…
Amir Saniyan
  • 13,014
  • 20
  • 92
  • 137
-5
votes
0 answers

fgets() chokes when encountering double forward slashes

I am using fgets() to parse a text file that contains hashed passwords (brypt). This hash contains a few characters additional to alphanumeric, but to my knowledge no special characters in C. My problem is that fgets() unexpectedly chokes when…
-6
votes
1 answer

Error: implicit declaration of function [c]

I included math.h library and used abs function and this error shows: error: implicit declaration of function ‘abs’ [-Werror=implicit-function-declaration] razlika=(abs(x3) / ((x1+x2)/2))*100; ^ cc1: some warnings being treated as errors
-8
votes
3 answers

Why C standards contain many unsafe functions, which are useless?

Why C standards contain many unsafe functions, which are useless (in good programs them don't use) and harmful, for example getchar? Why C standard doesn't contain instead of them the useful functions, for example getch, and getche? It is only one…
Andrey Bushman
  • 11,712
  • 17
  • 87
  • 182
1 2 3
42
43