473,549 Members | 2,889 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C / C++ Forum

C / C++ programming language - Get answers to questions about compilers, visual C++, templates, namespaces, classes, data structures, OOP (object-oriented programming), inheritance, data types, exceptions, Standard Template Library (STL) and the C Standard Library.
87
5,486
thread by: CJ | last post Mar 20 '08 by: Keith Thompson
Hello: We know that C programs are often vulnerable to buffer overflows which overwrite the stack. But my question is: Why does C insist on storing local variables on the stack in the first place? I can see two definite disadvantages with this: 1) deeply nested recursive calls to a function (especially if it defines
87
3,674
thread by: pereges | last post Jun 27 '08 by: Bart
I have a C program which I created on Windows machine. I have compiled and executed the program on windows machine and it gives me the consistent output every time i run it. for eg. input a = 2, b =3 lets say a sum operation is to be performed, then: output: 5
87
3,269
thread by: rufus | last post Jul 28 '08 by: David Thompson
Is there a C-compiler (and for that matter C++ compiler) for windows that can be run from the commmand line?
86
3,866
thread by: Randy Yates | last post Nov 14 '05 by: Keith Thompson
In Harbison and Steele's text (fourth edition, p.111) it is stated, The C language does not specify the range of integers that the integral types will represent, except ot say that type int may not be smaller than short and long may not be smaller than int. They go on to say, Many implementations represent characters in 8 bits, type...
86
4,067
thread by: Walter Roberson | last post Nov 14 '05 by: S.Tobias
If realloc() finds it necessary to move the memory block, then does it free() the previously allocated block? The C89 standard has some reference to undefined behaviour if one realloc()'s memory that was freed by realloc(), but the only way explicitly mentioned in the C89 standard to free memory via realloc() is to realloc() it down to 0...
85
3,208
thread by: masood.iqbal | last post Nov 14 '05 by: Chris Hills
I know that this topic may inflame the "C language Taleban", but is there any prospect of some of the neat features of C++ getting incorporated in C? No I am not talking out the OO stuff. I am talking about the non-OO stuff, that seems to be handled much more elegantly in C++, as compared to C. For example new & delete, references, consts,...
85
3,678
thread by: | last post Apr 3 '06 by: Micah Cowan
List, I'm looking for C links for Standard C for a website targeting professional SW engineers. Intent is to have a convenient reference to Standard C, particularly for those who come from backgrounds with a good bit of specialized extensions. I've plenty of Standards for my industry--a subset of embedded systems work, but I need more...
85
4,069
thread by: abhi | last post May 8 '06 by: Richard Heathfield
hi everybody am new to this group and help me to learn C
85
4,774
thread by: fermineutron | last post Nov 20 '06 by: Dave Thompson
Some compilers support __asm{ } statement which allows integration of C and raw assembly code. A while back I asked a question about such syntax and was told that __asm is not a part of a C standard. My question now is: Is there a chance that such statement will become a part of C standard in the future? In some cases using asm language is...
85
5,267
thread by: g | last post Jan 12 '07 by: Lane Straatman
Hello, is there any library for C as Boost is for C++? thanks in advance,
85
2,347
thread by: pereges | last post Jun 27 '08 by: Keith Thompson
#include <stdio.h> typedef struct { double x, y, z; }vector; int main(void) { int i;
85
3,011
thread by: Bill Cunningham | last post Jun 27 '08 by: Keith Thompson
I have put together this program that seems to do what I want without error checking added yet. If I just run the program it produces a segmentation fault. If I add the proper value say 43.56 it's fine. Does anyone see what's wrong ? I have a c99 compiler. Thanks. #include <stdio.h> #include <stdlib.h> int main ( int argc, char *argv ) {...
84
5,835
thread by: Andy Glew | last post Jul 19 '05 by: Dave Vandervies
I am in search of any rigourous, scientific, academic or industrial studies comparing naming conventions in C++ or similar languages such as Ada: Specifically, are names formed with underscores more or less readable than names formed with MixedCase StudlyCaps camelCase?
84
3,865
thread by: Bibby | last post Nov 15 '05 by: Dave Thompson
Hi, I'm interested in getting started in the programming world. I've dabbled in C, C++ and VB6. Which would be the best language to focus my attention to regarding the following considerations: Hireability Portability Flexibility The likely candidates seem to be Java, VB.Net, C, C++, C#.
84
15,803
thread by: Peter Olcott | last post Jan 14 '07 by: Simon G Best
Is there anyway of doing this besides making my own string from scratch? union AnyType { std::string String; double Number; };
84
8,506
thread by: aarklon | last post Dec 2 '07 by: David Thompson
Hi all, I found an interesting article here:- http://en.wikipedia.org/wiki/Criticism_of_the_C_programming_language well what do you guys think of this article....??? Is it constructive criticism that needs to be appreciated always...???
84
3,454
thread by: jacob navia | last post Dec 2 '07 by: David Thompson
As many people know, I think that garbage collection is a good solution for many memory allocation problems. I am aware however, that nothing is "the silver bullet", not even the GC. A recent article in slashdot http://developers.slashdot.org/article.pl?sid=07/11/17/0552247 proves that.
84
571
thread by: s0suk3 | last post Nov 12 '08 by: Old Wolf
The task: Write a program that reads a set of words from standard input and prints the number of distinct words. I came across a website that listed a few programs to accomplish this task: http://unthought.net/c++/c_vs_c++.html (ignore all the language flaming :-), and thought that all of them did unnecessary operations, so I wrote my own....
83
2,974
thread by: user | last post Nov 14 '05 by: August Derleth
Hello, Here is the program #include stdio int main(void) { const int num = 100; int *ip;
83
15,535
thread by: rahul8143 | last post Nov 15 '05 by: Michael Wojcik
hello, what is difference between sizeof("abcd") and strlen("abcd")? why both functions gives different output when applied to same string "abcd". I tried following example for that. #include <stdio.h> #include <string.h> void main() { char *str1="abcd";
83
3,022
thread by: newby2c | last post Nov 15 '05 by: Corrupted Mind
My personal K&R (3rd edition) wish list: 1. That a 3rd edition is actually published! 2. Make any and all corrections from earlier editions. 3. Update to comply with the c99 Standard. 4. A reference to other C books to aid the programmer. 5. A listing of C related web sites. 6. For ease of use, an appendix of tables used in the text. 7....
83
7,745
thread by: deppy_3 | last post Jul 17 '06 by: Dave Thompson
Hi.I am started learning Programm language C before some time.I am trying to make a programm about a very simple "sell shop".This programm hasn't got any compile problem but when i run it i face some other ploblems which i can not correct.I would appreciated if someone take a look at my programm so as to help me.I tried many times to find out...
83
11,556
thread by: sunny | last post Oct 1 '06 by: Richard Heathfield
Hi All What is C99 Standard is all about. is it portable, i mean i saw -std=C99 option in GCC but there is no such thing in VC++.? which one is better ANSI C / C99? can i know the major difference between C99 & ANSI C standards?
83
3,900
thread by: achintmehta | last post Oct 19 '06 by: Keith Thompson
I am working on MontaVista Linux on a PPC board. The compiler I am using is a gnu cross compiler cross compiler (ppc-82xx-gcc) The application/software that is being run, is messing up the memory due to which a subsequent malloc fails. When the application core is dumped I do not get any backtrace in the code (although the application is...
83
3,868
thread by: Anonymous | last post Feb 15 '07 by: Grizlyk
Came across some code summarized as follows: char const* MyClass::errToText(int err) const { switch (err) { case 0: return "No error"; case 1: return "Not enough"; case 2: return "Too much"; default: return "Unknown error";

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.