Solved

what is code space

Posted on 2006-12-01
3
248 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

810 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