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 1008811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:49:44+00:00 2026-05-16T08:49:44+00:00

I hear/read about it sometimes when talking about .NET, for example managed code and

  • 0

I hear/read about it sometimes when talking about .NET, for example “managed code” and “unmanaged code” but I have no idea what they are and what are their differences. What are their difference, by definition? What are the consequences of using either of them? Does this distinction exist in .NET/Windows only?

  • 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-05-16T08:49:45+00:00Added an answer on May 16, 2026 at 8:49 am

    Managed Code

    Managed code is what Visual Basic .NET and C# compilers create. It runs on the CLR (Common Language Runtime), which, among other things, offers services like garbage collection, run-time type checking, and reference checking. So, think of it as, “My code is managed by the CLR.”

    Visual Basic and C# can only produce managed code, so, if you’re writing an application in one of those languages you are writing an application managed by the CLR. If you are writing an application in Visual C++ .NET you can produce managed code if you like, but it’s optional.

    Unmanaged Code

    Unmanaged code compiles straight to machine code. So, by that definition all code compiled by traditional C/C++ compilers is ‘unmanaged code’. Also, since it compiles to machine code and not an intermediate language it is non-portable.

    No free memory management or anything else the CLR provides.

    Since you cannot create unmanaged code with Visual Basic or C#, in Visual Studio all unmanaged code is written in C/C++.

    Mixing the two

    Since Visual C++ can be compiled to either managed or unmanaged code it is possible to mix the two in the same application. This blurs the line between the two and complicates the definition, but it’s worth mentioning just so you know that you can still have memory leaks if, for example, you’re using a third party library with some badly written unmanaged code.

    Here’s an example I found by googling:

    #using <mscorlib.dll>
    using namespace System;
    
    #include "stdio.h"
    
    void ManagedFunction()
    {
        printf("Hello, I'm managed in this section\n");
    }
    
    #pragma unmanaged
    UnmanagedFunction()
    {
        printf("Hello, I am unmanaged through the wonder of IJW!\n");
        ManagedFunction();
    }
    
    #pragma managed
    int main()
    {
        UnmanagedFunction();
        return 0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 499k
  • Answers 499k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The code given by you should work with minor changes:… May 16, 2026 at 12:36 pm
  • Editorial Team
    Editorial Team added an answer It's not possible. You should be able to catch if… May 16, 2026 at 12:36 pm
  • Editorial Team
    Editorial Team added an answer The fllowing site will help you out. http://facestutorials.icefaces.org/tutorial/hibernate-tutorial.html Lot of… May 16, 2026 at 12:36 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I often hear/read about interfaced based programming but I am not exactly clear on
We have all read about or heard about the stack class, but many of
In informatics theory I hear and read about high-level and low-level languages all time.
Often when reading about Tcl (e.g. http://antirez.com/articoli/tclmisunderstood.html ) you read that everything is a
i read about that with component-based frameworks, like yii, you could reuse every component
I have read several interesting C#/F# comparisons here on stackoverflow. So, first of all,
That is a common question, but I would like to hear some expert opinions.
As i clearly mentioned above, I would be glad to hear your ideas about
I've been coding on and off my whole life. I've mostly coded Perl, but
I am working on a personal project and although I do have a wiki

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.