I don't understand what he wants [closed] - c

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
The question is from "The C programming language" book and it reads "Write a program to determine the ranges of char, int, short, and long variables both signed and unsigned, by printing the appropriate values from standard headers or by direct computation."
My first problem is that I don't understand how can i directly print the values from standard headers... I don't even know what they are, I think i might have missed them while reading. And my second problem is I don't understand what he means by direct computation.
sorry if its a stupid question, I'm fairly new to programming.

Right above this exercise in The C Programming Language it says:
The standard headers <limits.h> and <float.h> contain symbolic constants for all of these sizes, along with other properties of the machine and compiler. These are discussed in Appendix B.
So, see Appendix B (page 257 in the second edition I have). =)

Related

What can LLVM represent that C cannot? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
As far as I know, it is almost true that any code that can be represented in the LLVM intermediate language, can also be represented in C, with two important exceptions:
Exceptions. (No pun intended.)
Signed integer arithmetic with well-defined behavior on overflow.
Is there anything else that can be represented in LLVM but not in C?
In addition to exception handling, other big features are garbage collection and out-of-the-box coroutines. Going to a lower level, there are trampoline intrinsics, patch points for JITs, and direct support for Obj-C ARC Runtime intrinsics.
C is Turing complete, so all of these things can be introduced to C with libraries and so on, but I put them as they are part of the LLVM language.
Metadata for example, including LLVM's branch-weight and debugloc metadata.
Except that they can if you're willing to be tortuous enough about the C you write. I think that's general: IF you're willing to write really tortuous, unidiomatic C, THEN you can write anything. So I vote to close this as unclear.
EDIT: Most things probably are expressible in C given enough discipline, verbosity and preprocessing directives, but I wonder about aliasing.

Undefined operations on integers in c [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I am trying to learn about integer representations in c and I am having a lot of difficulty understand the fact that some operations are undefined meaning they are inconsistent among systems. I find a lot of sources claiming to teach about how these things work sometimes slip in things that are specific to the architecture they are coding for.
When I am coding I intend never to rely on undefined behaviors that happen to work a certain way on most processors.
What is the definitive truth of what happens in c (across all systems) when things like truncation, extension, comparison are done and when unsigned and signed types are included in casting and arithmetic. Which of these operations have a defined behavior across all systems?
The definitive truth is the C standard. Links to versions of it are in this answer.

What exactly is the SEXP data type in R's C API and why is it used? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am aware of the wikipedia page on SEXP, and I know that it stands for symbolic expression. I know (vaguely) SEXP is notation to refer to tree data structures in Lisp, but I want to know what motivated the developers to call the data type of R objects in C SEXP. Why SEXP?
I am also confused because if R was made in C and Fortran, why would notation from Lisp be used? Or is SEXP a more general term? Maybe I'm missing something here.
R is, internally, kind of like Scheme with an S-compatible syntax. A lot of R's internals derive from Scheme concepts, like cons cells and lexical environments.
Back in the late 90s, I worked on a new (at the time) serialisation format for R; see my honours project paper, which explains a lot of this. (The email address on that paper isn't valid any more, so don't use that.)

why are only underscores used in c to name variables? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
why not other special symbols? Is this problem solved in advanced languages? I searched for this topic but didn't got satisfactory answer. Is the value of underscore is special(ASCII)? Hope I will find a good answer. Thanks..
Because that's the way the language is specified: see K&R appendix A section 2.2 (original ed) or 2.3 (2nd ed). The _ isn't special other than it is allowed to be used by the C specification.
If you look a bit further, you will see that most of the other punctuation characters are used as operators of one kind or another so you don't have much else to use for variable names anyway.
Some of us are old enough to remember the days when (on some compilers) the $ character was also allowed.
Generally White spaces are not allowed in C
In order to seperate word and word in names programmers use '_' there is no certain specific reason but it is better for readability rather than other special symbols
Try this
aditya*kiran
aditya_kiran
the second one is more readable

A byte has 8-bits. Can it be larger in another system? give an example [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
A byte has 8-bits. Can it be larger in another system? Give an example.
Also, how many different types of calls such as writeint,writedec,writestring,writechar are there in assembly language.
Thanks.
Not any more. There was a time, yes, when there were systems without a fundamental 8-bit byte.
System where 1 byte != 8 bit?
how many different types of call such as writeint,writedec,writestring,writechar are there in assembly language
This question makes no sense. Assembly language is just a means of writing code that translates directly to machine instructions. call is just one of these instructions - it jumps to some other section of code, with the intent of returning to the place where the call was made.
The things you're referring to sound more like library routines - in which case there are any number of them, depending on the programming environment.

Resources