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

Sending Data to particular IP in windows OS using ANSI C

I want to send data or packets at particular IP address using ANSI C standard so that my code will be platform independent. How is it possible in windows OS without using windows libraries like winsock etc.? Kindly give me some guidelines or hints.
Siddiqui
  • 7,662
  • 17
  • 81
  • 129
0
votes
3 answers

How to locate the first occurrence of a string in a string

I need a function like memchr() but it should be able to locate a substring(string), not an only single char. And it should return the first occurrence found in string. For example p1 = afunclikememchr(str1,"here the function that can locate this…
user2400925
0
votes
6 answers

ANCI C (C90): Can const be changed?

I am confused as to what ANSI specification says about changing a variable declared const can be legally modified through its address. Unfortunately I do not have access to C90 specification but got conflicting pointers: The keyword const doesn't…
Quiescent
  • 1,088
  • 7
  • 18
0
votes
2 answers

How do I set values inside a global, fixed-size array, in C (in Visual Studio)?

A part of my VS2012 Windows Phone project is in C. I've been struggling during one day trying to initialize an array to put stuff inside it. Whenever I try to initialize it as global (outside any function), then I get a message telling me that I…
Léon Pelletier
  • 2,701
  • 2
  • 40
  • 67
0
votes
3 answers

FFT and inverse of FFT

I am a computer programmer who work on a Telecommunication project. In our project I have to change a series of complex number to their Fourier transform.so I need an efficient FFT code for C89 standard. I am using the following code and it works…
bahrami307
  • 59
  • 1
  • 9
0
votes
2 answers

A replace to enum flags in C

I was using a lot enum flags in C programming language. A very good solution. But I have a problem now: I need to implement more than 32 flag-options, it's 1 << 32, that an enum can't hold because it's a too large value. So, how do I fix this?…
The Mask
  • 17,007
  • 37
  • 111
  • 185
0
votes
1 answer

C (C89) optimization with passing error codes

I am writing a shared/dynamic library (https://github.com/zsawyer/mumble-LinkAPI). For this I will provide some basic accessors (get, set and update) for the data in a shared memory struct (cannot be changed as it is externally defined). There are…
zsawyer
  • 1,824
  • 17
  • 24
0
votes
2 answers

Getting a function pointer to a dynamic library in C (C89)

I have a function pointer to a dynamic library, #include /* or something */ void (*vertex)(float, float) = &glVertex2f; On GCCi686-apple-darwin10-gcc-4.2.1 it's always worked, but fails on Visual Studio 2010 with, error 'vertex': address…
0
votes
2 answers

Clearing screen and kbhit() function

I got some problems writing my snake game program. I need to make game working on linux and windows. I found some topics how to clear screen on linux and windows using the #ifdef Windows etc. The problem is i need to use C89 standard, and im not…
General_Code
  • 239
  • 1
  • 4
  • 12
0
votes
2 answers

sys/socket missing member for msgdr: msg_control, msg_controllen, msg_flags

I'm trying to write a little Client-Server application using the UNIX DOMAIN SOCKETS. I'm using the msghdr for the sendmsg/recvmsg but when I compile the following code, it gives me the following error: include ... struct msghdr…
Mario
  • 978
  • 2
  • 11
  • 31
0
votes
1 answer

Static Library created in VS2010 not linkeable in CVI

I created a simple static Ansi-C90 library with VS2010. I was able to create a C++ project in VS2010, import and fully test the lib. I opened a LabWindows CVI project and tried to import the lib file there. Unfortunatelly there is not much to go on…
Johannes
  • 6,490
  • 10
  • 59
  • 108
0
votes
2 answers

Declarations for enums, and structures

I have wrote some files: main.c, functions.c, functions2.c, and header.h. The some functions in the functions.c, and functions2 use my some enums, and structures. Where must I place my enums, and structures? How to write declarations for them in…
Andrey Bushman
  • 11,712
  • 17
  • 87
  • 182
0
votes
1 answer

C90 Cast to underlying abstract type

A logging structure that depends on logging related functions looks like this: typedef struct { TFkt_vlogf vlogf; TFkt_outf outf; void* logData; } TLogger; In this logging function there is an abstract logData that is assigned with…
Johannes
  • 6,490
  • 10
  • 59
  • 108
0
votes
1 answer

struct casting ansi c 89

Are struct well defined in strict c 89? I mean this code struct a { int a, b; void * c; } k; //init k... struct b { int u, w; long *data; } p = *(struct b*)&k; is going to work on every compiler that support the standard? If I…
marco6
  • 352
  • 2
  • 12
0
votes
1 answer

Compile C99 compliant .so on Windows

I'm using the StarRuby (https://github.com/hajimehoshi/starruby) library and am attempting to compile the latest version to a .so file for linking in my ruby project. However, after acquiring the needed libraries for compilation, and running the…