This is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 5 | ← | Archive 8 | Archive 9 | Archive 10 | Archive 11 | Archive 12 | → | Archive 15 |
The C language doesn't provide built-in support for object-oriented code (nor in fact for several interesting features), though those can be constructed. There are well-known examples of class-structures in C, e.g., X Window System. It would be nice to reduce the persistent intrusion of POV-based edits in this area. Tedickey ( talk) 20:06, 11 December 2008 (UTC)
It is kind of curious to see C# in the open standard article, but not C.
Is there a reason for that ?
If not, could someone who knows a bit about the subject add it there ?
The image File:Kr c prog lang.jpg is used in this article under a claim of fair use, but it does not have an adequate explanation for why it meets the requirements for such images when used here. In particular, for each page the image is used on, it must have an explanation linking to that page which explains why it needs to be used on that page. Please check
This is an automated notice by FairuseBot. For assistance on the image use policy, see Wikipedia:Media copyright questions. --13:49, 8 February 2009 (UTC)
Regarding my addition reverted in rev. 274795659, is not the reference to the WG14 year 2005 draft of the C standard sufficient to substantiate my re-phrasing of the actual paragraph 7 of section 6.3.2.3? -- ilgiz ( talk) 23:55, 3 March 2009 (UTC)
char *external_buffer = "abcdef"; uint32_t *internal_data; internal_data = (uint32_t *)external_buffer; // UNDEFINED BEHAVIOUR if "the resulting pointer is not correctly aligned" // Also, *internal_data results in different values on big- and little-endian CPUs.
char *external_buffer = "abcdef"; // Apparently, it goes without saying that automatic and static variables are guaranteed to be correctly aligned uint32_t internal_data1; uint32_t *internal_data = &internal_data1; // Alternatively, section 7.20.3 "Memory management functions" guarantees that malloc() returns an address of a super-aligned block // uint32_t *internal_data = malloc(sizeof(uint32_t)); // assuming the network order of the external data and that the protocol stipulates a 4-byte field in the beginning *internal_data = (((((uint32_t)(external_buffer[0]) << 8) | external_buffer[1]) << 8) | external_buffer[2]) << 8) | external_buffer[3];
If the "printed copy" referred to by the description of rev. 281338283 is the "Annex A (informative): Language syntax summary" section of the current standard WG14/N1256, one could mention that section as a reference. I guess the formal grammar does not define the language, its environment and its library, but only serves informative purpose. -- ilgiz ( talk) 19:16, 2 April 2009 (UTC)
I don't want to edit this, in case the consensus is that it is too far removed, but I believe C# is based on C++ therefore should be mentioned as a "related language" to C, which started it all. The C# article does say this. KoolerStill ( talk) 11:17, 23 April 2009 (UTC)
There is a List of C functions with a separate article on each function. I can't see a link to this from this article. Is this deliberate? or is the list destined for deletion? I think it might be a little too detailed for an encyclopedia, but if it is there it should be linked to the main article on the language. KoolerStill ( talk) 11:58, 23 April 2009 (UTC)
In the infobox next to “Paradigm,” C is tagged as being an “imperative (procedural)” programming language. Why are these two attributes not listed separately and independently (i. e., simply separated by commas, rather than one being in parentheses)? Does being either necessarily imply the other, or, conversely, is it impossible to be one but not the other? I’m not a programming language expert, and therefore would like clarification from one of the article’s authors. Thanks! — Technion ( talk) 16:36, 2 May 2009 (UTC)
Without resorting to X-Macros, a C programmer cannot loop across enum values. In the best case, when the minimum and the maximum values for the enum are known and when there are no holes in the definition, a regular for loop will result in a warning that the condition is always true. I wonder if this may theoretically cause a run-time exception or lock-up with C implementations that insist on enum value consistency.
e_t evar; for (evar = e_first; evar <= e_last; evar++) { ... continue; ... }
This best-case scenario could probably be rewritten as follows.
e_t evar; for(evar = e_first; ; evar++) { ... goto next; ... next: if (evar == e_last) { break; } };
-- ilgiz ( talk) 21:35, 4 May 2009 (UTC)
for(evar = e_first; evar != e_last; evar++) {...}
enum { E_FIRST = 0, E_SECOND = 2, E_LAST = 1 };
Hidden editor comment in article: "Also, present consensus is against lang="c". " May I ask why? Isn't syntax highlighting a good thing? I can see turning it off for the outdated K&R example, but why is it off for the normal "Hello World!" example? -- Cybercobra ( talk) 23:57, 10 May 2009 (UTC)
Seeing as there hasn't been any real pushback on this, I'm going to turn syntax highlighting on again. Most of our high-profile programming language articles use it now, so the inconsistency here doesn't seem to be warranted. Chris Cunningham (not at work) - talk 10:51, 3 July 2009 (UTC)
The section on syntax about operator evaluation includes the following sentence: "This permits a high degree of object code optimization by the compiler, but requires C programmers to exert more care to obtain reliable results than is needed for other programming languages." Many other languages don't actually specify an order of evaluation for operands, so I would have thought C's approach was far more reliable. I propose that the sentence be truncated to ""This permits a high degree of object code optimization by the compiler." Any objections ? Cadae ( talk) 07:11, 27 June 2009 (UTC)
why calling c language is middle level language —Preceding unsigned comment added by 59.164.2.104 ( talk) 15:24, 10 August 2009 (UTC)
JTC1/SC22/WG14's ISO/IEC 9899 page states "The most current draft of the revised C99 standard is available in N1336." Update to links section required. - 204.111.152.29 ( talk) 02:34, 19 October 2009 (UTC)
hi,
my question is about constant pointer
Can you make a constant character pointer point to some other string —Preceding unsigned comment added by 122.167.74.225 ( talk) 14:26, 20 October 2009 (UTC)
The article says:
despite being a C programmer that have abandoned C++ for the PODs issues, I must say there is no generic programming whatsoever in C, unless the preprocessor is counted; and since the preprocessor provides no type control whatsoever, counting the preprocessor is not justified. ... said: Rursus ( bork²) 10:43, 17 January 2009 (UTC)
It does support a limited form of generic programming with generic pointers; qsort is a good example. Mike92591 ( talk) 21:09, 17 January 2009 (UTC)
Under "Operators", there's a group "sequencing" containing only the comma operator, which links to the Sequence Point page. Is this right? While the comma operator is certainly a sequence point, that does not appear to be its primary purpose. From K&R:
Comma operators should be used sparingly. The most suitable uses are for constructs strongly related to each other, as in the for loop in reverse, and in macros where a multistep computation has to be a single expression.
-- Mcaruso ( talk) 20:44, 24 May 2009 (UTC)
for(p=base,i=0;i<MAX;++p,++i)
and if(++p,++i>=MAX)
. There isn't any name or Wikipedia page for "programming convenience", but there is for "sequence point". —
DAGwyn (
talk) 02:46, 24 July 2010 (UTC)The "minimalism" paragraph talks about the relative ease of implementing compilers that generate efficient machine code, and cites the DEC PDP-11 as a case in point. To expand on the intent of the paragraph I added mention of C compilers for some 8-bit platforms, linking to one that has a Wikipedia page. My two questions are:
1. While the PDP-11's CPU is also 16 bits, the original article seems to stress its 16-bit address space, not the CPU itself; apparently the intent is to stress the compactness of the generated object code as well as access to arbitrary addressable objects. However, the ability to compile efficient object code for simpler CPUs with far less sophisticated instruction sets also testifies to this point. Reading over my edit, though, it seems the juxtaposition of text stressing address space in one case and CPU data size in the other seems possibly confusing. Does anyone have an opinion on this?
2. I am only aware of one such compiler ( Aztec_C). My first shot at the sentence said something like, "There is at least one..." That looked awkward, so I changed it to simply "Compliers for..." I can't say with certainty if the plural is actually correct. Does this matter or can the plural wording be considered to be generic and covering both cases?
Rhsimard ( talk) 23:21, 19 September 2009 (UTC)
This is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 5 | ← | Archive 8 | Archive 9 | Archive 10 | Archive 11 | Archive 12 | → | Archive 15 |
The C language doesn't provide built-in support for object-oriented code (nor in fact for several interesting features), though those can be constructed. There are well-known examples of class-structures in C, e.g., X Window System. It would be nice to reduce the persistent intrusion of POV-based edits in this area. Tedickey ( talk) 20:06, 11 December 2008 (UTC)
It is kind of curious to see C# in the open standard article, but not C.
Is there a reason for that ?
If not, could someone who knows a bit about the subject add it there ?
The image File:Kr c prog lang.jpg is used in this article under a claim of fair use, but it does not have an adequate explanation for why it meets the requirements for such images when used here. In particular, for each page the image is used on, it must have an explanation linking to that page which explains why it needs to be used on that page. Please check
This is an automated notice by FairuseBot. For assistance on the image use policy, see Wikipedia:Media copyright questions. --13:49, 8 February 2009 (UTC)
Regarding my addition reverted in rev. 274795659, is not the reference to the WG14 year 2005 draft of the C standard sufficient to substantiate my re-phrasing of the actual paragraph 7 of section 6.3.2.3? -- ilgiz ( talk) 23:55, 3 March 2009 (UTC)
char *external_buffer = "abcdef"; uint32_t *internal_data; internal_data = (uint32_t *)external_buffer; // UNDEFINED BEHAVIOUR if "the resulting pointer is not correctly aligned" // Also, *internal_data results in different values on big- and little-endian CPUs.
char *external_buffer = "abcdef"; // Apparently, it goes without saying that automatic and static variables are guaranteed to be correctly aligned uint32_t internal_data1; uint32_t *internal_data = &internal_data1; // Alternatively, section 7.20.3 "Memory management functions" guarantees that malloc() returns an address of a super-aligned block // uint32_t *internal_data = malloc(sizeof(uint32_t)); // assuming the network order of the external data and that the protocol stipulates a 4-byte field in the beginning *internal_data = (((((uint32_t)(external_buffer[0]) << 8) | external_buffer[1]) << 8) | external_buffer[2]) << 8) | external_buffer[3];
If the "printed copy" referred to by the description of rev. 281338283 is the "Annex A (informative): Language syntax summary" section of the current standard WG14/N1256, one could mention that section as a reference. I guess the formal grammar does not define the language, its environment and its library, but only serves informative purpose. -- ilgiz ( talk) 19:16, 2 April 2009 (UTC)
I don't want to edit this, in case the consensus is that it is too far removed, but I believe C# is based on C++ therefore should be mentioned as a "related language" to C, which started it all. The C# article does say this. KoolerStill ( talk) 11:17, 23 April 2009 (UTC)
There is a List of C functions with a separate article on each function. I can't see a link to this from this article. Is this deliberate? or is the list destined for deletion? I think it might be a little too detailed for an encyclopedia, but if it is there it should be linked to the main article on the language. KoolerStill ( talk) 11:58, 23 April 2009 (UTC)
In the infobox next to “Paradigm,” C is tagged as being an “imperative (procedural)” programming language. Why are these two attributes not listed separately and independently (i. e., simply separated by commas, rather than one being in parentheses)? Does being either necessarily imply the other, or, conversely, is it impossible to be one but not the other? I’m not a programming language expert, and therefore would like clarification from one of the article’s authors. Thanks! — Technion ( talk) 16:36, 2 May 2009 (UTC)
Without resorting to X-Macros, a C programmer cannot loop across enum values. In the best case, when the minimum and the maximum values for the enum are known and when there are no holes in the definition, a regular for loop will result in a warning that the condition is always true. I wonder if this may theoretically cause a run-time exception or lock-up with C implementations that insist on enum value consistency.
e_t evar; for (evar = e_first; evar <= e_last; evar++) { ... continue; ... }
This best-case scenario could probably be rewritten as follows.
e_t evar; for(evar = e_first; ; evar++) { ... goto next; ... next: if (evar == e_last) { break; } };
-- ilgiz ( talk) 21:35, 4 May 2009 (UTC)
for(evar = e_first; evar != e_last; evar++) {...}
enum { E_FIRST = 0, E_SECOND = 2, E_LAST = 1 };
Hidden editor comment in article: "Also, present consensus is against lang="c". " May I ask why? Isn't syntax highlighting a good thing? I can see turning it off for the outdated K&R example, but why is it off for the normal "Hello World!" example? -- Cybercobra ( talk) 23:57, 10 May 2009 (UTC)
Seeing as there hasn't been any real pushback on this, I'm going to turn syntax highlighting on again. Most of our high-profile programming language articles use it now, so the inconsistency here doesn't seem to be warranted. Chris Cunningham (not at work) - talk 10:51, 3 July 2009 (UTC)
The section on syntax about operator evaluation includes the following sentence: "This permits a high degree of object code optimization by the compiler, but requires C programmers to exert more care to obtain reliable results than is needed for other programming languages." Many other languages don't actually specify an order of evaluation for operands, so I would have thought C's approach was far more reliable. I propose that the sentence be truncated to ""This permits a high degree of object code optimization by the compiler." Any objections ? Cadae ( talk) 07:11, 27 June 2009 (UTC)
why calling c language is middle level language —Preceding unsigned comment added by 59.164.2.104 ( talk) 15:24, 10 August 2009 (UTC)
JTC1/SC22/WG14's ISO/IEC 9899 page states "The most current draft of the revised C99 standard is available in N1336." Update to links section required. - 204.111.152.29 ( talk) 02:34, 19 October 2009 (UTC)
hi,
my question is about constant pointer
Can you make a constant character pointer point to some other string —Preceding unsigned comment added by 122.167.74.225 ( talk) 14:26, 20 October 2009 (UTC)
The article says:
despite being a C programmer that have abandoned C++ for the PODs issues, I must say there is no generic programming whatsoever in C, unless the preprocessor is counted; and since the preprocessor provides no type control whatsoever, counting the preprocessor is not justified. ... said: Rursus ( bork²) 10:43, 17 January 2009 (UTC)
It does support a limited form of generic programming with generic pointers; qsort is a good example. Mike92591 ( talk) 21:09, 17 January 2009 (UTC)
Under "Operators", there's a group "sequencing" containing only the comma operator, which links to the Sequence Point page. Is this right? While the comma operator is certainly a sequence point, that does not appear to be its primary purpose. From K&R:
Comma operators should be used sparingly. The most suitable uses are for constructs strongly related to each other, as in the for loop in reverse, and in macros where a multistep computation has to be a single expression.
-- Mcaruso ( talk) 20:44, 24 May 2009 (UTC)
for(p=base,i=0;i<MAX;++p,++i)
and if(++p,++i>=MAX)
. There isn't any name or Wikipedia page for "programming convenience", but there is for "sequence point". —
DAGwyn (
talk) 02:46, 24 July 2010 (UTC)The "minimalism" paragraph talks about the relative ease of implementing compilers that generate efficient machine code, and cites the DEC PDP-11 as a case in point. To expand on the intent of the paragraph I added mention of C compilers for some 8-bit platforms, linking to one that has a Wikipedia page. My two questions are:
1. While the PDP-11's CPU is also 16 bits, the original article seems to stress its 16-bit address space, not the CPU itself; apparently the intent is to stress the compactness of the generated object code as well as access to arbitrary addressable objects. However, the ability to compile efficient object code for simpler CPUs with far less sophisticated instruction sets also testifies to this point. Reading over my edit, though, it seems the juxtaposition of text stressing address space in one case and CPU data size in the other seems possibly confusing. Does anyone have an opinion on this?
2. I am only aware of one such compiler ( Aztec_C). My first shot at the sentence said something like, "There is at least one..." That looked awkward, so I changed it to simply "Compliers for..." I can't say with certainty if the plural is actually correct. Does this matter or can the plural wording be considered to be generic and covering both cases?
Rhsimard ( talk) 23:21, 19 September 2009 (UTC)