what is code space

Posted on 2006-12-01
Last Modified: 2010-04-01
I am supposed to explain/define “code space” as part of a homework problem in C++ but I couldn’t find much with Google.  Can someone explain it in lame terms?
Question by:melged
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Author Comment

ID: 18057900
Duh!  Forgot to type my inquiry before I hit submit.

I am supposed to explain/define “code space” as part of a homework problem in C++ but I couldn’t find much with Google.  Can someone explain it in lame terms?


Expert Comment

ID: 18058549
code space?
never heard of it@@
maybe you means code scope or name space?
LVL 11

Accepted Solution

cup earned 50 total points
ID: 18059374
Wiki is your friend

You will probably need to explain by example.  These are stored in code space: it is basically any code that cannot be changed while the program is running

const char* myname = "wo de ming zi";
int HowMany (int* x)
   int count;

   for (count = 0; x[count] != 0; ++count)
   return count;

These will be in data space

int x[50];
bool robert;

Codespace is increased when the routines appear in headers - every source file that includes the header has a copy of the routine.  This is a very common problem with coders who love inline code.  In the old days when space was limited, codespace was reused with overlays.  Nowadays, space isn't a problem and automatic paging takes care of it.

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question