# What's the relationship between C and C++?

**URL:** <https://boards.straightdope.com/t/whats-the-relationship-between-c-and-c/950446>\
**Category:** Factual Questions\
**Created:** [September 10, 2021, 10:58am UTC](https://boards.straightdope.com/t/whats-the-relationship-between-c-and-c/950446 "2021-09-10T10:58:48Z")\
**Posts on this page:** 4\
**Page:** 8

<div class="post-metadata">

**Author:** ![Melbourne](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Melbourne](https://boards.straightdope.com/u/Melbourne)\
**Post date:** [September 18, 2021, 9:05am UTC](https://boards.straightdope.com/t/whats-the-relationship-between-c-and-c/950446/141 "2021-09-18T09:05:59Z")

</div>

> [@wolfpup](#):
>
> You did? If you did, you never posted it.

You didn’t understand it. That’s ok.

> [@GreenWyvern](#):
>
> ’m sure that’s the case on Linux, but I just checked on Windows, and I don’t see libc.dll or any similar system files that could be identified as C supporting dlls.

MS doesn’t have a c compiler, and hasn’t for decades. The operating system is compiled and linked using the current version of MSVC++ (this is a fundamental difference between different versions of Windows, and is why you can’t transfer OS components from WinXP to Win2K etc.)

Operating system was MSVCRT.DLL (Microsoft Visual C++ RunTime). Applications were statically or dynamically linked to MSVCR80.dll or 90, or 20 or 110 or … Since 5 or 6 years ago, they’re recompiling the operating system all the time, and updating VC++ all the time, and they’ve split the Visual C++ RT into a front and a back: the front changes with each new version of VC++, and the back, UCRTBASE.DLL doesn’t change… except actually, it does change all the time, as you can see by looking in application directories. It’s over 1MB now, and not getting any smaller.

---

<div class="post-metadata">

**Author:** ![wolfpup](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/wolfpup/32/10618_2.png) [@wolfpup](https://boards.straightdope.com/u/wolfpup)\
**Post date:** [September 18, 2021, 10:19am UTC](https://boards.straightdope.com/t/whats-the-relationship-between-c-and-c/950446/142 "2021-09-18T10:19:37Z")

</div>

> [@Melbourne](#):
>
> You didn’t understand it. That’s ok.

You didn’t post it (that “I tried to explain that Pascal that and FORTRAN did not have a ‘monolithic’ runtime”). If you did, please quote where you did so. And, as I explain below with a specific example, that statement is wrong anyway. That’s OK.

> [@Melbourne](#):
>
> MS doesn’t have a c compiler, and hasn’t for decades.

That wasn’t the question. The question was where is the DLL corresponding to the C standard library. As explained **[in this Microsoft document](https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features?view=msvc-160)**, ucrtbase.dll **contains the ISO C standard library** (libc) as well as some components for C++. It is the dynamically linkable equivalent of the static library libucrt.lib, which is only provided with Visual Studio or the Windows SDK. It’s not really a runtime system, though Microsoft calls it that, but rather the standard library of C functions that is usually dynamically linked at runtime, but the programmer could optionally choose to statically link it with the .lib file.

From an architectural perspective one could say that C has a very minimal runtime, as indeed I’ve cited several times, called CRT0. On Windows CRT0 is always statically linked. One could therefore argue that C has no runtime at all, or certainly no runtime dependency, since it could easily be built that way.

While the distinction as to just what a runtime is may sometimes be unclear in modern language implementations, especially with dynamic linking, the distinction was very clear in legacy implementations of languages like FORTRAN, making the statement that it “did not have a monolithic runtime” completely and demonstrably false. One need only look at a legacy system like FORTRAN on the PDP-10 (DECsystem10) timesharing system to see a clear example of this architecture.

The FORTRAN system on the PDP-10 had four components: the compiler itself, the runtime system called FOROTS (OTS=Object Time System), the FORTRAN library called FORLIB used by the linker, and a debugging component called FORDDT which isn’t relevant here.

One notes that the runtime system had the .SHR file extension (FOROTS.SHR). The file extension .SHR referred to what was called a shareable high segment, logically part of the user process, but mapped to a common shared virtual high memory segment that was pure code, with all the user-specific data in the low segment. This architecture was commonly used to allow system programs to serve multiple users with only one copy of the pure code, with the variable data in the user’s low segment. The FORTRAN object time system being a SHR **meant that it was mapped as a monolithic entity to the high segment of the user’s virtual address space**. Thus a running FORTRAN program consisted of the user’s compiled code plus any needed library functions and subroutines in the low segment, and the essential runtime system in the high segment.

Other FORTRAN implementations weren’t as elegant but made a similarly clear distinction between the FORTRAN library and the runtime system. It’s much less obvious in C because basically there isn’t really a runtime system at all in any such sense (let alone a big one), by design.

---

<div class="post-metadata">

**Author:** ![Melbourne](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Melbourne](https://boards.straightdope.com/u/Melbourne)\
**Post date:** [September 18, 2021, 10:22am UTC](https://boards.straightdope.com/t/whats-the-relationship-between-c-and-c/950446/143 "2021-09-18T10:22:29Z")

</div>

> [@wolfpup](#):
>
> This argument is going around in circles and I don’t think any further discussion would be productive.

This argument is going around in circles and I don’t think any further discussion would be productive.

---

<div class="post-metadata">

**Author:** ![wolfpup](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/wolfpup/32/10618_2.png) [@wolfpup](https://boards.straightdope.com/u/wolfpup)\
**Post date:** [September 18, 2021, 1:41pm UTC](https://boards.straightdope.com/t/whats-the-relationship-between-c-and-c/950446/144 "2021-09-18T13:41:07Z")

</div>

Incidentally, although C has always been present in Visual Studio as part of the C++ implementation, and VS was touted as also a C development platform, it’s now fully C11 and C17 compliant:

> **[Microsoft Visual Studio beefs up support for C language](https://www.infoworld.com/article/3575529/microsoft-visual-studio-beefs-up-support-for-c-language.html)**
>
> C11 and C17 become supported C language versions starting with Visual Studio 2019 16.8 Preview 3

[Previous page](https://boards.straightdope.com/t/whats-the-relationship-between-c-and-c/950446.md?page=7)
