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 C99 Standards Document is more expensive than C11, C18 versions?

C18 is developed version of C11 as C11 is developed version of C99. Then I think Price of C99 < Price of C11 < Price of C18 is right. I’m trying to learn C as my first programming language. And I thought Standard’s of C helps me a lot about my…
lev.1 code
  • 87
  • 7
0
votes
2 answers

Return Value 3221225477?

I am quite new to coding so please go easy on me Here's my code /* Open File*/ FILE *openFile(char filename[], char filetype[]); /* Read Number Of Nurses */ int readNurses(void); /* Title */ void title(void); /* Login Screen*/ int loginScreen(); /*…
0
votes
0 answers

Seeding pseudo-random function with limited set of C99 standard functions

I'm working on school project, particularly, implementing openssl genrsa command. School project limits available functions to open, close, read, write, malloc, free. One of the option flags for genrsa command is rand. As I understand from man page,…
0
votes
1 answer

Case variadic macro in C with 2+ parameters

The accepted answer in this question answers how to create a macro that would choose from 2 available other macros (one taking 1 parameter and the other taking 2). https://stackoverflow.com/a/55075214/1036082 How to write the code in case the 2…
Łukasz Przeniosło
  • 2,725
  • 5
  • 38
  • 74
0
votes
1 answer

"return false" is neglected and not being returned

Note:I have edited my code to provide clear and minimal steps to reproduce the error. I wrote the following code using C99 standrad: #include #include bool FillMatrix(int MatrixSize, int Matrix[][10]) { int CellValue=0; …
user12420727
0
votes
1 answer

Is it better to redeclare a struct inside function or declare it static and set to 0 everytime?

Basically, if I have a struct like: struct header { char ptr[512]; }; and I have a function like so: void some_function() { struct header header = { 0 }; // do something with struct } Would it actually benefit performance-wise to do it like…
Alex Gh
  • 55
  • 5
0
votes
1 answer

Initializing static array using int variable from inside a struct

I'm working with a typedef used to represent an image, seen here: typedef struct { int rows; // Vertical height of image in pixels // int cols; // Horizontal width of image in pixels // unsigned char *color; // Array of…
marqzman
  • 3
  • 2
0
votes
1 answer

Why is this usage of typedef-ed function an error?

I have the following code: #include typedef void (*myfunc_t)(int x); myfunc_t myfunc(int x) { printf("x = %d\n", x); return; } int main(void) { myfunc_t pfunc = myfunc; (pfunc)(1); return 0; } When compiling for…
ysap
  • 7,723
  • 7
  • 59
  • 122
0
votes
1 answer

IAR compiler C dialect set to C99 to access the 'dlib' but is still accessing 'clib'

I have a project with an application and a bootloader running on IAR version 7.12.1. For the most part these are the same and access the same files with the exception of a few. I have IAR project "C/C++ Compiler"->"Language 1"->"C dialect"->"C99"…
Beau R
  • 53
  • 5
0
votes
4 answers

How to free a malloc'd 2D array in C?

The following is my code and I cannot figure out where I am going wrong to free my 2d array. I know that the error happens at this line: free(arr[i]); and I also know that I have to do this loop to free each integer before freeing the entire array…
0
votes
2 answers

Can an array be statically alocated if we don't know the length of the array during compilation in c99?

I'm unsure if this is correct, I included an example of what I mean: #include #include #include int main(int argc, char** argv){ int duzina; duzina = strlen(argv[1]); char novi[duzina+1]; …
someoneb100
  • 141
  • 1
  • 13
0
votes
1 answer

Accessing struct array of unsigned ints

I have a struct that has space for unsigned ints: typedef struct { unsigned int *arr; } Contents; When I allocate memory: Contents *Allocator() { Contents *cnt = malloc(sizeof(Contents)); cnt->arr = calloc(1, sizeof(unsigned…
Rio
  • 14,182
  • 21
  • 67
  • 107
0
votes
1 answer

C preprocessor macro

The problem: I'm writing a general C library for an LCD in a microcontroller project. up to 8 LCDs with various sizes(e.g. 128*96 or 64*48) in various addresses may be added (e.g. LCD3 and LCD7). but only one of them is actively coded at a time. so…
0
votes
1 answer

How to use 64-bit integers in 32-bit compiler?

I am currently writing a program to run on a Microchip PIC18 MCU. I use xc8 (v1.45 -I have to use this version-) compiler and working in MPLAB IDE. In this version of the compiler, there is no 64-bit integer support. I need to use 64-bit integers…
0
votes
0 answers

Implicit declaration of function 'system' is invalid in C99

I've read other questions regarding this problem but I still don't understand how I would create a prototype for both of these functions. I am currently using Xcode. The two functions that are showing problems are exit and system. #include…
paul
  • 1
  • 1
1 2 3
99
100