The tag has no wiki summary.

learn more… | top users | synonyms

-1
votes
1answer
29 views

Writing a stack module (c++) [closed]

I am stuck on the following exercise. Is it possible to write this code without using classes? 1) Write a stack module (two files stack.cpp ...
0
votes
0answers
14 views

“break;” out of “if” statement? [migrated]

Can you break out of an if statement or is it going to cause crashes? I'm starting to acquaint myself with C, but this seems controversial. The first image is from a book on C ("Head First C") and the ...
1
vote
0answers
21 views

Declaring, changing, and adding to an array of a list of structs in C [migrated]

I've created a struct and the struct has a metric on it. I am generating a series of these structs and I want to sort them into an array based on this metric. Basically, if the metric is 0, I want it ...
2
votes
1answer
194 views

Numerical stability of C++: will a C++ program using a float or double library return the same arithmetical results on two different computers?

Say I am using boost or the built-in float or double mathematical libraries of my C++ compiler. I distribute the program. Will the execution of my C++ program on different machines given different ...
4
votes
1answer
113 views

Is the Syntax of C Language completely defined by CFGs?

I think the Question is self sufficient. Is the syntax of C Language completely defined through Context Free Grammars or do we have Language Constructs which may require non-Context Free definitions ...
6
votes
6answers
2k views

Why do negative array indices make sense?

I have came across a weird experience in C programming. Consider this code: ...
2
votes
2answers
275 views

Handling untrusted string input in printf in C [closed]

I stumbled upon the MSDN Best Practices for Code Review. Under the section “Untrusted Inputs”, I found following which I didn't understand properly. Why is the following considered safe? ...