Solved

what is code space

Posted on 2006-12-01
3
239 Views
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?
0
Comment
Question by:melged
3 Comments
 

Author Comment

by:melged
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?

Thanks.
0
 
LVL 3

Expert Comment

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

Accepted Solution

by:
cup earned 50 total points
ID: 18059374
Wiki is your friend http://en.wikipedia.org/wiki/Code_space

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.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

867 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now