Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8810813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:12:34+00:00 2026-06-14T03:12:34+00:00

I am just learning programming really, and, while reading C++ Primer Plus (5th Ed.),

  • 0

I am just learning programming really, and, while reading C++ Primer Plus (5th Ed.), I came across the statement that “any valid C program is a valid C++ program” and I am curious to see how far I can take that statement.

The book is pretty good, but is that statement necessarily true?

Is there any reason to not create a new file in CodeBlocks and choose that it be a C++ file despite my intentions of writing only C code for a particular project, instead of choosing to call it a C file? For example, maybe I will start writing something in C and realize down the road that I want to start using some of the C++ features, would it not have mattered what I decided in the beginning since I can just change the file extension afterwards?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T03:12:36+00:00Added an answer on June 14, 2026 at 3:12 am

    The statement is outright false. There are plenty of C programs that are not valid C++ programs, and I would go so far as to say that any non-trivial C program that’s properly written is not a valid C++ program. Hint: char *p = malloc(n); is not valid C++.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I'm really new to programming, I just started learning Python yesterday and I'm
I'm just now learning to programming at age 17. It's hard for me to
I'm learning JavaFX and this is just a small programming question. I have 3
I'm learning C++. For me, my programming style is just what looks the best;
I'm just learning MVC3 now and this is really confusing me. I have a
I'm a real noob who just started learning 3d programming and i have a
I am just learning objective-c and iPhone development, and I am really struggling with
I've been programming for a while, but just recently decided to start developing for
So I've been reading up on the D programming language for a while, and
I'm just learning Objective-C/Cocoa programming for the Mac. All of the tutorials, books, blogs,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.