ansi-c Questions

37

Solved

How to make printf to show the values of variables which are of an enum type? For instance: typedef enum {Linux, Apple, Windows} OS_type; OS_type myOS = Linux; and what I need is somethin...
Rosalinarosalind asked 23/2, 2011 at 16:7

5

Solved

I’m looking for a free copy version of the C89/C90 standard, but I can’t find it anywhere! Why is so hard to find it? C99 and C11 standards are very easy to get a copy of on Internet. Even in...
Deontology asked 9/6, 2013 at 22:34

2

Solved

In line tab[i] = tab[i+1] - tab[i] + (tab[i+1] = tab[i]); I have a warning [Warning] operation on '*(tab + ((sizetype)i + 1u) * 4u)' may be undefined [-Wsequence-point] I want to swap these ...
Waist asked 18/11, 2016 at 12:36

4

Solved

When terminating a string, it seems to me that logically char c=0 is equivalent to char c='\0', since the "null" (ASCII 0) byte is 0, but usually people tend to do '\0' instead. Is this purely out ...
Coypu asked 6/6, 2013 at 7:16

2

Solved

Is there any way to declare variable in if statement (using ANSI C only) ? Example: if(int variable = some_function()) { return 1; }
Hagar asked 26/4, 2017 at 19:51

10

Solved

Having namespaces seems like no-brainer for most languages. But as far as I can tell, ANSI C doesn't support it. Why not? Any plans to include it in a future standard?
Concordat asked 9/12, 2010 at 8:14

2

I don't know why, but I've had no problem before and now all of a sudden, this really old, terrible, newbie program that I wrote a long time ago, triggers Malwarebytes... :( This question is not a...
Ventose asked 23/4, 2013 at 4:59

2

Solved

I compiled the following c program with gcc -ansi -pedantic -Wall test.c: #include <stdio.h> #include <stdint.h> #define BUFFER 21 int main(int argc, char* argv[]) { uint64_t num = 0x...
Bergschrund asked 4/7, 2013 at 4:37

4

Solved

I'm having an issue trying to nest structs that I need to declare as new var types. The code is the following- typedef struct { typedef struct { int day, month, year; } Date; Date manuDate...
Karyoplasm asked 4/5, 2015 at 0:9

1

Solved

Is it possible that a function in ANSI C cannot be accessed from some other file? How and when functions have limited access? At first I thought that if a function is not included in any header it'...
Crescint asked 30/3, 2020 at 13:56

3

Solved

I'm building tool for testing ansi c applications. Simply load code, view control flow graph, run test, mark all vertexes which were hit. I'm trying to build CFG all by myself from parsing code. Un...
Reason asked 6/5, 2013 at 7:23

6

Solved

Suppose we have two structs: typedef struct Struct1 { short a_short; int id; } Struct1; typedef struct Struct2 { short a_short; int id; short another_short; } Struct2; Is it safe to cast f...
Mogilev asked 2/1, 2012 at 15:47

4

For Example, If I write int var; var=-8/-5; As per operator precedence, -8/-5 would be equivalent to ((-8)/(-5)). But will it be possible for C89 to give two values like for the case of -8/5 it...
Fabricate asked 27/4, 2018 at 18:50

4

Solved

It's 2012. I'm writing some code in C. Should I be still be using C89? Are there still compilers that do not support C99? I don't mind using /* */ instead of //. I'm not sure about C89 forbids mi...
Rounders asked 12/8, 2012 at 21:25

5

Solved

I have started programming practice on codechef and have been confused by the difference between C and C99. What does C mean here? Is it C89? Check the languages at the bottom of this submit. It co...
Mantelletta asked 20/6, 2013 at 6:21

2

Solved

atof() returns a double, which results in a warning when I assign it to a float-value (and yes, I definitively have to use float). So my question: is there a atof()-variant available which returns...
Bilabiate asked 7/12, 2016 at 8:40

3

Solved

I'm working on a large project in C, and I want to organize it using interface (.h) and implementation (.c) files, similar to many object-oriented languages such as Objective-C or Java. I am famili...
Georgy asked 5/10, 2014 at 17:34

2

Solved

Some background: the header stdint.h is part of the C standard since C99. It includes typedefs that are ensured to be 8, 16, 32, and 64-bit long integers, both signed and unsigned. This header is ...
Hagerty asked 6/10, 2016 at 19:33

2

Solved

Starting from this SO protected question I'm trying to understand what the difference between those documents: 9899 2012 costs $60 9899 2011 costs $265 As you can see those documents have very ...
Swaim asked 3/8, 2016 at 10:15

1

Solved

Why did the original C language not support initial declarations in for loop initializations? Obviously the original creators, and then the pre-C99 standardizations, didn't specify it that way. Bu...
Borries asked 31/1, 2016 at 6:17

5

Solved

C89 (C90, ANSI-C) does not allow intermixing variables declaration with code. I wonder to what extent a variable initialization is considered "code". Perhaps it's only valid to initialize with con...
Ummersen asked 25/9, 2015 at 16:28

1

Solved

There a very handy function in Python: repr() which when applied on a string containing blank characters will print out a representation of that string that cannot lead to any human misinterpretati...
Shend asked 12/9, 2015 at 20:25

2

Solved

I have a two dimensional array and want to sort both rows depending on the order of the elements in the first row: i start with: row1: { 4, 3, 1, 5, 0} row2: { 7, 8, 9, 1, 2} and the result sho...
Mama asked 26/9, 2013 at 15:47

4

Solved

While answer warning: assignment from incompatible pointer type for linklist array, I noticed any undeclared identifier perceded with struct keyword are considered as forward declared identifiers. ...
Hypercorrect asked 9/6, 2015 at 7:37

4

Solved

if (abs(u) > Vdc) u = Vdc*((u > 0) - (u < 0)); This code is in C considering we enter the if condition what will happen ? Vdc = 24; consider any arbitrary value of u for an explanation...
Liddie asked 8/4, 2015 at 18:21

© 2022 - 2025 — McMap. All rights reserved.