473,387 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

memory structure in C and value of EOF

1)How is the memory structure organised in C. i.e., the way in which
the stack and heap memory are used in C.

2) What will be the value of EOF.
Nov 14 '05 #1
5 3579
Migrators <bk*******@yahoo.com> scribbled the following:
1)How is the memory structure organised in C. i.e., the way in which
the stack and heap memory are used in C.
Depends entirely on the implementation.
2) What will be the value of EOF.


A negative integer value.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"Bad things only happen to scoundrels."
- Moominmamma
Nov 14 '05 #2
In 'comp.lang.c', bk*******@yahoo.com (Migrators) wrote:
1)How is the memory structure organised in C. i.e., the way in which
the stack and heap memory are used in C.
The C language doesn't define stack nor heap. The local variables belong to
the automatic memory. The allocated variables belong to the allocated memory.
The way they are managed on your platform is beyond the C-language
definition. It's an implementation issue, and you don't need these details to
write standard C programs. If you insist, the details are in your compiler
manual.
2) What will be the value of EOF.


It's EOF. (a negative int). Actually, you don't need to know the binary
value. If you insist, the value is defined in <stdio.h>.

--
-ed- get my email here: http://marreduspam.com/ad672570
The C-language FAQ: http://www.eskimo.com/~scs/C-faq/top.html
C-reference: http://www.dinkumware.com/manuals/reader.aspx?lib=c99
FAQ de f.c.l.c : http://www.isty-info.uvsq.fr/~rumeau/fclc/
Nov 14 '05 #3
>1)How is the memory structure organised in C. i.e., the way in which
the stack and heap memory are used in C.
Chances are it WON'T be organized by the AFL-CIO. But ANSI C does
not rule out that possibility.

What type of answer did you expect? Alphabetically by Social
Security Number? There's a Presidential Structure, and under that
are the vice-structures, and under that there are the assistant
vice-structures and manager-structures, ... and under that there
are the janitor-structures? That the list of allocated memory is
kept in a SQL database in sub-dungeon in the basement of Microsoft
corporate headquarters, and you'll be taxed on every piece of memory
you use? I believe all of these are allowed by ANSI C, but they
are rather unlikely implementations.

ANSI C doesn't make requirements on HOW you have to implement this
stuff, just that it needs to work as required.
2) What will be the value of EOF.


The value of EOF is EOF, a negative integer. Contrary to popular
opinion, its value is NOT guaranteed to be -42.

Gordon L. Burditt
Nov 14 '05 #4

"Gordon Burditt" <go***********@burditt.org> wrote in message
That the list of allocated memory is kept in a SQL database in sub-
dungeon in the basement of Microsoft corporate headquarters, and
you'll be taxed on every piece of memory you use? I believe all of
these are allowed by ANSI C, but they are rather unlikely
implementations.

I don't see what is unlikely about this. Presumably you will be charged for
each byte when allocated, and also for each read or write. 1s will be
charged at a higher rate than 0s, because of extra electricity used.

Nov 14 '05 #5
>> That the list of allocated memory is kept in a SQL database in sub-
dungeon in the basement of Microsoft corporate headquarters, and
you'll be taxed on every piece of memory you use? I believe all of
these are allowed by ANSI C, but they are rather unlikely
implementations.

I don't see what is unlikely about this. Presumably you will be charged for
each byte when allocated, and also for each read or write. 1s will be
charged at a higher rate than 0s, because of extra electricity used.


Microsoft corporate headquarters is already full of copies of every
computer document you ever created (all versions) and every keystroke
you ever made. The archive goes all the way down to Hell, and fills
it. There's no *ROOM* for a database of allocated memory in the
corporate headquarters. The real database is kept in the headquarters
of its wholly-owned subsidiary, the IRS.

Microsoft charges not only for allocating the memory, but for how
long you use it, in spite of the fact that it's YOUR memory that
YOU paid for. This is one reason why Windows has so many memory
leaks - it's a revenue-enhancing feature.

Gordon L. Burditt

Nov 14 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Eirik WS | last post by:
Consider the following code: #include <stdio.h> #include <stdlib.h> typedef struct { int x; int y; } tals;
9
by: CptDondo | last post by:
I am working on an embedded platform which has a block of battery-backed RAM. I need to store various types of data in this block of memory - for example, bitmapped data for control registers,...
62
by: ivan.leben | last post by:
How can I really delete a preloaded image from memory/disk cache? Let's say I preload an image by creating an Image object and setting its src attribute to desired URL: var img = new Image();...
11
by: skumar434 | last post by:
Hi everybody, I am faceing problem while assigning the memory dynamically to a array of structures . Suppose I have a structure typedef struct hom_id{ int32_t nod_de; int32_t hom_id;
12
by: FI | last post by:
Hello All, I am relatively new to C programming and I am struck with a problem in dynamic memory allocation. I would like to know if it is ok to pass the 'memory address' returned by...
12
by: Sam Kong | last post by:
Hi, JavaScript hides its memory structure. I know that numbers, booleans, null and undefined are value types (value is directed saved in a variable). I want to know: - How JavaScript...
14
by: raghu | last post by:
Hello , This is Raghu. I have a problem in declaring a structure. Consider struct hai{ int id; char sex; int age; }; here when a variable is instianted for this structure then immediately
18
by: MajorSetback | last post by:
I am using the Redhat version of Linux and GNU C++. It is not clear to me whether this is a Linux issue or a C++ issue. I do not have this problem running the same program on Windows but...
5
by: Mahendra Kumar Kutare | last post by:
I am trying to implement a webserver with boss-worker model thread pool implementation - I have a header declaration threadpool.h as - typedef struct threadpool_work { void (*routine) ();...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.