GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 03-May-2009, 10:27
shafaatmosvi shafaatmosvi is offline
New Member
 
Join Date: May 2009
Posts: 1
shafaatmosvi is on a distinguished road

Null Character '\0'


Why is the null character generated by the compiler at the end of the string during runtime and how?
  #2  
Old 03-May-2009, 10:57
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 5,309
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: Null Character '\0'


Quote:
Originally Posted by shafaatmosvi
Why ... and how?
Your question of "why and how" is based on the premise that it is generated at run time. It is not generated at run time, so the question is ill-posed, and is, therefore, unanswerable.

So, instead of attempting to answer the unanswerable, I will respond with two questions of my own:
  1. Why do you assume that it is generated at run time?

  2. What would you really like to know?

Regards,

Dave
Last edited by davekw7x : 03-May-2009 at 11:56.
  #3  
Old 03-May-2009, 14:31
Alan Alan is offline
New Member
 
Join Date: Aug 2008
Location: London UK
Posts: 14
Alan is on a distinguished road

Re: Null Character '\0'


Perhaps shafaatmosvi means compiler run time, which is a stretch. The answer is to mark the end of the string so that it may be accessed by no more than a char pointer.
  #4  
Old 05-May-2009, 06:38
ocicat ocicat is offline
Regular Member
 
Join Date: May 2008
Posts: 586
ocicat is a jewel in the roughocicat is a jewel in the rough

Re: Null Character '\0'


Quote:
Originally Posted by shafaatmosvi
Why is the null character generated by the compiler at the end of the string during runtime and how?
At runtime, the compiler does nothing; it has no effect whatsoever.
 
 

Recent GIDBlogProblems with the Navy (Enlisted) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
20 questions game monkeeass83 C++ Forum 1 21-Mar-2008 03:32
Str_Misaligned in Double Link List Peter_APIIT C Programming Language 1 29-Feb-2008 20:50
Airport Log program using 3D linked List : problem reading from file batrsau C Programming Language 11 29-Feb-2008 07:44
triangle (polygon), drawing, sizing, and rotation programme using linked lists... promsan C Programming Language 12 14-May-2007 14:03
Reading non ASCII with read() Atomical C Programming Language 8 13-Sep-2005 14:30

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 08:02.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.