473,769 Members | 6,597 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Doubts regarding C++ runtime

Hi,
I have been reading some text on C and C++ (i.e advanced books). One
of the books mentioned that C++ requires a runtime support whereas C
does not - what the author was trying to say was that once you compile
a C program the executable created is all that is needed whereas if you

compile a C++ program the executable created requires a C++ runtime
installed on your system to run the program.
Can someone please provide more information on this or could provide a
link to some webiste where this concept is explained in detail. I
would like to know the differences in C and C++ compiled code which
makes a runtime necessary for one and not for the other.

I had posted this on the comp.lang.c group but found that this topic
doesn't fit into that group, so trying my luck here.

Thanks
Ritesh

Jul 23 '05 #1
2 1364
* Ritesh Kapoor:
I have been reading some text on C and C++ (i.e advanced books). One
of the books mentioned that C++ requires a runtime support whereas C
does not
A formally correct program requires runtime support in both languages.

For example, globals are (usually) initialized before 'main' is executed.

Usually that support is statically linked. Whether it is depends on the
implementation and what you direct it to do. Both languages also have
implementations where you can choose to not use the runtime support.

- what the author was trying to say was that once you compile
a C program the executable created is all that is needed whereas if you
compile a C++ program the executable created requires a C++ runtime
installed on your system to run the program.


No.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 23 '05 #2
Ritesh Kapoor wrote:

Hi,

I have been reading some text on C and C++ (i.e advanced books). One
of the books mentioned that C++ requires a runtime support whereas C
does not - what the author was trying to say was that once you compile
a C program the executable created is all that is needed whereas if you

compile a C++ program the executable created requires a C++ runtime
installed on your system to run the program.


Ahm, no.
The author is right, that C++ needs more runtime support (because eg. there
is much more going to happen during program startup). But he is not right
in saying that this runtime needs to be *installed* on a system. All
development systems I am aware of provide 2 options: Either you can ship
the runtime in the form of a 'shared library' or you can link the runtime
into the final executable. This is true for C *and* C++. So it is only
the programmer itself that makes the decission if he wants to ship 1
executable and get rid of the problem of having some to ship some libraries
in the correct version with his product or to ship just one single executable
and don't have that problem.
--
Karl Heinz Buchegger
kb******@gascad .at
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2214
by: Samuel | last post by:
I wrote a very simple httpmodule and tried to compile it with no success. This is my code: ============== Imports System Imports System.Web Imports Microsoft.VisualBasic NameSpace myErrorHandler
6
1582
by: ritesh | last post by:
Hi, I have been reading some text on C and C++ (i.e advanced books). One of the books mentioned that C++ requires a runtime support whereas C does not - what the author was trying to say was that once you compile a C program the executable created is all that is needed whereas if you compile a C++ program the executable created requires a C++ runtime installed on your system to run the program. Can someone please provide more...
2
1306
by: VMI | last post by:
I'm having doubts as to how the compiler interprets this If statement: bool bIsTrue = true; if (! bIsTrue) { //RUN PROCESS } Here, will "RUN PROCESS" be executed? Or is this just wrong? How is this
1
1391
by: archana | last post by:
Hi all, I want to clear one doubt which i am facing regarding timer. Suppose i have one timer in which i am generating some files. and interval of my timer is say 5 min. Say suppose at then my files are generated at time 12:30 am and then as i set interval to 5 next file should gets generated to 12:35 but what if i change my system time to 12:25 or 12:34.
1
1664
by: 418928 | last post by:
Hi everybody, I have some doubts about RDF. I hope you can help me with them: -In http://www.w3.org/TR/rdf-primer, they use the namespace "http://www.example.org/terms/">", but the URL "http:// www.example.org" does not exist, so it doesn't define any terms. Is this out-of-date? -Difference between rdf:about and rdf:ID. Can I use only rdf:about?
10
1510
by: Rob | last post by:
I am reading a book that says that the "name" property can be altered only at design time and cannot be modified at runtime. Please explain this given the code below... If you click Button3... fred will appear as the Name of Button1, however, the handler for Button1 works still works as well... Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
1
1005
by: msanjayv | last post by:
Hi I have a two doubt's regarding constructor. Consider the following situation. I have two classes A & B. A is the base class and B is a class which inherits class A. I have main function in class B and I create an object for class B. So, first the class A constructor gets executed (since it is the base class) and then the class B constructor gets executed. 1) When I use parameters in both the constructor I am forced to use base...
3
1386
by: parag_paul | last post by:
http://concentratedlemonjuice.blogspot.com/2008/06/about-c-puzzles-on-my-blog.html Try this one for 30 chapters on C++ doubts,
1
1787
by: ramasubramanian.rahul | last post by:
hi people.. dont know if this the right forum for this doubt ... so sorry if i am mis-posting... i was looking at the way glib 2.10.3 does export optimization using a list of "to be exposed" function names in a file caleed glib.symbols. this file is used by a perl script to generate a header a .c file ( galias.h and galiasdefs.c). This files essentially enusres default visibility for these functions (using the __attribute__((default))__...
0
10214
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9996
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3963
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.