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
-1
votes
1 answer

ANSI C S-Linked List - deleteLast() not functioning correctly

When trying to run my deleteLast() function twice (to get an empty list) on a linked list with two nodes, I am running into a problem. The code compiles and runs, but when I call traverse() on my empty linked list, I get an infinite while loop, and…
Elliot
  • 83
  • 7
-1
votes
1 answer

OpenBSD 5.9 header with C99 inline function

I'm building a custom shell and see when I compile that usr/include/ctype.h:92 seem to require c99 inline function but the compiler says that C99 inline functions are not supported. The warning can be disabled with a parameter to the compiler but…
Niklas Rosencrantz
  • 25,640
  • 75
  • 229
  • 424
-1
votes
3 answers

C programming Strings printing

I have a question on this string . for example: char ex1[20]="Hello hi"; int choose; scanf("%d",&choose); What should I do to make it print "hi" when user enters 1 and "hello" would be printed if he enters 0? Thank you for your help.
-1
votes
2 answers

Adding 32 bit signed in C

I have been given this problem and would like to solve it in C: Assume you have a 32-bit processor and that the C compiler does not support long long (or long int). Write a function add(a,b) which returns c = a+b where a and b are 32-bit…
DonRobb
  • 57
  • 4
-1
votes
2 answers

Index operator bound to a string literal

So I decided to experiment, completely out of randomness. And I found this: "Hello World"[1] Actually working on a first view, resulting in 'e' even though: I haven't encounter this anywhere until happened to be in my code Seems semantically…
Imobilis
  • 1,475
  • 8
  • 29
-1
votes
1 answer

Runtime error on Ideone but works fine on my computer

I was writing a program for finding out Intersection of two sorted arrays in C language. The code works fine when I compile it with GCC on my machine and run it, but gives a runtime error on ideone.com. Here is the Live link to the below code:…
hemant6488
  • 277
  • 3
  • 11
-1
votes
1 answer

How to print out the members of a struct, weird errors?

I've been trying to print of the members of a struct I have created, however there are a few declarations errors that are showing saying my structs are undeclared. I have a separate function for printing the members of the struct. I have no idea on…
George Cavalevu
  • 119
  • 1
  • 2
  • 6
-1
votes
2 answers

Casting small fields in a structure to a larger variable

I have a situation in a legacy code with a large field of a structure being split into two sub-fields. For example, a uint32 is split into two uint16's: typedef struct { uint16 myVar_H; uint16 myVar_L; } MyStruct; Until now these fields…
Eli Iser
  • 2,788
  • 1
  • 19
  • 29
-1
votes
5 answers

How can I implement an array whose size is not known at compile time in C89?

Sorry, I'm a bit of a newbie to C and was wondering how you could create an array whose size is not known at compile time before the C99 standard was introduced.
user2246521
  • 83
  • 3
  • 12
-1
votes
1 answer

Using sprintf with mysql_query

I'm using a mysql snippet that connects to my mysql database (locally) in ANSI C. Everything is working perfectly, but I've been trying to create a function that connects to my database and inserts a new record based on some variables. I'm using…
Fastidious
  • 1,249
  • 4
  • 25
  • 43
-2
votes
1 answer

Is it possible to get the file name of a pointer in Windows?

As far as I have researched on SO, in order to obtain the file name from a pointer(perhaps a memory location), we'll need to get it's File Descriptor No. which could then be used to indirectly request the OS for the file name. Maybe by navigating…
-2
votes
1 answer

Scanf stores wrong value inside integer variable

I have wrote the following code using c programming language (Standard 89): #include #include int main() { int cc,dd; scanf("%d/%d",&cc,&dd); int ll; scanf("%d",&ll); printf("Value of ll is: %d",ll); …
-2
votes
1 answer

how to revers a diagonal matrix in C?

and if we want to reverse diagonal matrix, like: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 and if we reverse the diagonals it will be like that: 5 2 3 4 1 6 9 8 7 10 11 12 13 14 15 16 19 18 17 20 25 22 23 24…
-2
votes
1 answer

What is a conventional way to find the header file corresponding to a C function?

I am using ssize_t in a piece of C code. I don't know which header file it is declared. So I start googling and then get buried and lost among many unrelated stuff. This scenario happens over and over again to me, and it wastes much time. So, is…
zell
  • 9,830
  • 10
  • 62
  • 115
-2
votes
1 answer

store object in an array using ansi c?

I make a structure just like struct abc { //any function or variable } obje[20]; now I want that the each object of abc store in array. means that arr[0] contain obj[0] only; can it is possible. if it is possible then some one help me in this…
QAZI
  • 15
  • 2
1 2 3
42
43