Questions tagged [kr-c]

For questions about K&R C, the pre-standard language described in the first edition of "The C Programming Language" by Kernighan & Ritchie

This tag is for questions about the pre-standard C language as defined by the first version of "The C Programming Language" by Brian Kernighan and Dennis Ritchie, published in 1978.

The second edition of the book was published shortly before ratification of the first standard in 1990 and describes that version of the language (C90).

For questions about the book, use instead.

36 questions
0
votes
3 answers

UINT_MAX the same as ULONG_MAX in C

While solving exercises from the K&R C book, I stumbled upon the exercise 2.1. At first I got as UINT_MAX as -1, but then I used the %u placeholder, but now its giving me the same number as ULONG_MAX. In the book in Appendix B, they say that…
hakuna matata
  • 3,243
  • 13
  • 56
  • 93
0
votes
2 answers

Accessing the parameters passed to a function with an empty parameter list in C

Since functions with empty parameter lists can be passed a variable number of parameters in C, Suppose I have a function defined as : void foo(){ // I want to access the parameters passed in here } And I call it with arguments, say foo(1,2,3); Is…
0
votes
1 answer

What is the value of putchar(c) here '_'?

What is the value of putchar(c) outside loop? main() { int c; while (c = getchar() != EOF) { printf("printf c_inloop :%d\n",c); printf("Putchar c_inside: "); putchar(c); printf("\n\n"); } putchar(c); printf("printf…
user2282137
  • 39
  • 10
0
votes
1 answer

At least the first 31 or 63 characters of an internal name are significant?

Here's a direct quote from the Book (K&R, 2nd ed, p. 35): "At least the first 31 characters of an internal name are significant. For function names and external variables, the number may be less than 31, because external names may be used by…
HATEM EL-AZAB
  • 331
  • 1
  • 3
  • 11
-1
votes
1 answer

Void argument in function definition but primitive data type in declaration

I have a query with below code. How does the below code gets interpreted as per K&R c? There is no compilation error and the code runs just fine. I have used -traditional in build option in codeblocks. Searched around for a while but could not get a…
Soujanya
  • 59
  • 4
-4
votes
1 answer

c99: 63 characters of an internal name are significant?

Possible Duplicate: At least the first 31 ,or 63 characters of an internal name are significant? Here's a direct quote from the Book (K&R, 2nd ed, p. 35): "At least the first 31 characters of an internal name are significant. For function…
HATEM EL-AZAB
  • 331
  • 1
  • 3
  • 11
1 2
3