Skip to content

Truth in Software

Common Code, Coding Conundrums, Creative Cures, Computing Craft

Tag: C++

In C++, when should I use a class vs a struct?

Ken Gregg May 29, 2019January 29, 2021

In C++, the only technical difference between a struct and a class is that, by default (i.e., if you don’t specify anything), members of struct are public while members of a class are private. You can achieve encapsulation in a …

Read more
The C++ Programming Language

Can I return more than one thing from a C or C++ function?

Ken Gregg January 23, 2019January 29, 2021

Yes. Whether or not a function can return more than one value depends on the specific programming language you’re using and on whether you’re talking about pure functions  or impure functions. Many programming languages, including C and C++, chose the traditional mathematical …

Read more
C and C++ Languages

What is the third parameter I sometimes see defined in the main function?

Ken Gregg January 18, 2019January 29, 2021

The third parameter to the main function is not standard or portable in C or C++, but in practice, most modern compiler implementations allow an optional third parameter to main. The data type of this third parameter is pointer to …

Read more
C and C++ Languages

Why don’t they add a garbage collector to new versions of C and C++?

Ken Gregg January 17, 2019January 29, 2021

Let’s start by considering C++. As an opt-in option in C++, it is technically possible to add garbage collection to C++, as long as it is clearly specified how it integrates with the language and with the existing memory management …

Read more
C and C++ Languages

What would happen if a bitwise operator like ^ were applied to objects of a C++ user-defined class?

Ken Gregg January 15, 2019January 29, 2021

The behavior depends on what conversions and operator overloads are defined for these types of objects. To simplify the discussion, let’s say that the objects you’re talking about are instances of class X. According to the C++ standard, bitwise operators …

Read more
The C++ Programming Language

Why do people still use Python, C, C++, C#, and Java when there is Go?

Ken Gregg December 15, 2018January 29, 2021

I know and use several programming languages in my software and firmware development projects. There is a core set that I use most often, because they happen to be the right tools for the job. Early on, I learned several …

Read more
Programming Languages

Will a game engine in Python be slower than one written in C++?

Ken Gregg December 14, 2018January 29, 2021

If we assume that: The Python programmers are highly competent, and The C++ programmers are highly competent, and Python is interpreted, and C++ compiles to native (machine) code, and has typical optimizations enabled in the compiler, and There is no …

Read more
The C++ Programming Language

Friend Classes in C++

Ken Gregg September 13, 2018January 29, 2021

I get quite a few questions about when or whether it’s a good idea to declare friend classes in C++. Here is some background and advice on the use of friend classes. Recall that members of a class that are …

Read more
The C++ Programming Language

Keeping the Console Window Open in Visual Studio 2017

Ken Gregg September 11, 2018January 29, 2021

Starting with version 15.8.0 of Visual Studio 2017, which was released August 14, 2018, you have a new option for controlling whether the console window closes automatically when your C and C++ console-based application terminates, and what information you see …

Read more
Visual Studio

Disabling warnings from legacy and third-party header files

Ken Gregg August 20, 2018January 29, 2021

I am a huge fan of warnings in C and C++. I have always taken warnings from the compiler seriously, and tell my students to get used to taking them seriously, too. Warnings are the compiler’s way of telling you: …

Read more
C and C++ Languages
  • ← Previous

Links

  • Log in
  • Register
  • Entries RSS
  • Comments RSS
  • Blog Home
  • Bytellect LLC Home
  • Recommended Reading
  • Free Developer Resources

Categories

  • Bytellect LLC (4)
  • Computing History (2)
  • Operating Systems (2)
    • Windows (1)
  • Software Development (61)
    • .NET Framework (1)
    • Best Practice (10)
      • Code Reviews (1)
      • Maintainability (3)
      • Program Organization (2)
    • C and C++ Languages (9)
    • Code Optimization (3)
    • Data Structures and Algorithms (2)
    • Programming Languages (5)
    • Programming Paradigms (1)
      • Object-Oriented Programming (1)
    • Project Management (2)
    • Software Testing (2)
    • The Business of Software (3)
      • Career Advice for Software Engineers (2)
    • The C Programming Language (8)
    • The C++ Programming Language (7)
    • Visual Studio (3)
    • Windows Programming (1)
  • Vintage Computing (1)
    • TRS-80 (1)

Archives

Recommended Reading





More Recommended Reading

Bytellect LLC is a participant in the Amazon Associates Program, and may earn commissions from qualifying purchases at Amazon.com.


Tags

C++C programming languagelanguage featurecode maintainabilitycareer developmentcode readabilityThe C# Programming Languageportabilitycareer advicecoding standardsreadabilitysource code portabilityvisual studiocompiler optimizationsoftware maintenancelow-level languageprogrammingC99 standardBoolean data typekeyword
More Tags Less Tags
Bytellect LLC Logo

Terms of Use  |  Privacy Policy  |  Cookie Policy

Copyright © 2017- Bytellect LLC.   All rights reserved.

Copyright © 2021 Truth in Software.
Powered by WordPress. | Theme: colorskin by Dimitrakopoulos.