Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > how the following two code parts same

Reply
Thread Tools

how the following two code parts same

 
 
Keith Thompson
Guest
Posts: n/a
 
      12-08-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) writes:
> Keith Thompson wrote:
>> (E-Mail Removed) writes:

[...]
>> > {
>> > char i = NULL;

>>
>> NULL is a null *pointer* constant. Assigning it to a char object
>> might happen to work, but it makes no sense. You probably mean

>
> Given that it is C++ code, it will work. In C++, NULL has to have a
> value of 0; it cannot have a pointer type.


True, but using NULL for anything other than a pointer value is poor
style in any case.

--
Keith Thompson (The_Other_Keith) <(E-Mail Removed)>
Looking for software development work in the San Diego area.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
 
 
 
James Kuyper
Guest
Posts: n/a
 
      12-08-2007
Keith Thompson wrote:
> (E-Mail Removed) writes:
>> Keith Thompson wrote:
>>> (E-Mail Removed) writes:

> [...]
>>>> {
>>>> char i = NULL;
>>> NULL is a null *pointer* constant. Assigning it to a char object
>>> might happen to work, but it makes no sense. You probably mean

>> Given that it is C++ code, it will work. In C++, NULL has to have a
>> value of 0; it cannot have a pointer type.

>
> True, but using NULL for anything other than a pointer value is poor
> style in any case.


Agreed.
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Serious issue: parts of my page render as not logged in, parts as logged in. Help! pcloches@gmail.com ASP .Net 1 04-12-2007 12:50 AM
Difference between "library parts" of C99 and "language parts" of C99 albert.neu@gmail.com C Programming 3 03-31-2007 08:14 PM
Parts parts....PARTS!!! ARGHHH dstvns A+ Certification 8 01-07-2004 07:57 PM
How come most multi parts dont have all parts? 123 Computer Support 2 09-22-2003 01:55 PM



Advertisments