Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Const Problem

0 views
Skip to first unread message

io_x

unread,
Jan 15, 2010, 4:14:27 AM1/15/10
to

"venka...@gmail.com" <battula...@gmail.com> ha scritto nel messaggio
news:5c262bec-ae20-4ddf...@a32g2000yqm.googlegroups.com...
> Hi Friends,
> I got problem hear,
>
> C++ File:
>
> const int val=0;
> int *ptr = (int *)&val;
> *ptr = 55;
> cout<<val<<endl; // out put 0
> cout<<*ptr<<endl; // out put 55
>
> in debugging val & *ptr are showing 55 only,
> but while printing val it is showing '0' as out put
> while printing *ptr it is showing '55' as out put
>
> what is the problem, i am unable to get could u pls help me out.

repeat with me:
const very ugly;
private protected friend template, ugly;
pass by references for one function or operator good;
references like alias ugly;
pointers good;
classes good;
constructor/distrctor very good;
malloc/free good;
C++ library seems ugly;
C library seems ugly;
C and C++ (operator, overloading too) languages very good;
assembly languge [or base language] very good;

frank

unread,
Jan 15, 2010, 4:31:48 AM1/15/10
to

I used to program "somewhere between" C and C++, starting with Microsoft
development products. I think it was MVC++ 4.

One thing I liked about the Gemisch was that I could calculate a value
with C syntax, and just cout<< once I found it. The conversion
specifiers for printf are a huge pain in the ass until you stack up
enough references that you've got a decent chance of getting it right.

I think I ended up on the C side because of the pull from unix.
--
frank

Richard Heathfield

unread,
Jan 15, 2010, 5:23:45 AM1/15/10
to
frank wrote:

<snip>

> One thing I liked about the Gemisch was that I could calculate a value
> with C syntax, and just cout<< once I found it. The conversion
> specifiers for printf are a huge pain in the ass until you stack up
> enough references that you've got a decent chance of getting it right.

Well, you only need to stack up one (good) reference.

> I think I ended up on the C side because of the pull from unix.

As in "Oh I do like to be beside the C side"? I knew Unix was
attractive, but I didn't realise it was tidal.

Lenore will be pleased.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
So who is Lenore anyway? There will be a test later on.

red floyd

unread,
Jan 15, 2010, 5:38:53 PM1/15/10
to
On Jan 15, 2:23 am, Richard Heathfield <r...@see.sig.invalid> wrote:
> > I think I ended up on the C side because of the pull from unix.
>
> As in "Oh I do like to be beside the C side"? I knew Unix was
> attractive, but I didn't realise it was tidal.
>
>
I think he just gravitated towards it...

io_x

unread,
Jan 23, 2010, 2:57:19 AM1/23/10
to

"io_x" <a...@b.c.invalid> ha scritto nel messaggio
news:4b50301b$0$817$4faf...@reader5.news.tin.it...

>
> "venka...@gmail.com" <battula...@gmail.com> ha scritto nel messaggio
> news:5c262bec-ae20-4ddf...@a32g2000yqm.googlegroups.com...
>> Hi Friends,
>> I got problem hear,
>>
>> C++ File:
>>
>> const int val=0;
>> int *ptr = (int *)&val;
>> *ptr = 55;
>> cout<<val<<endl; // out put 0
>> cout<<*ptr<<endl; // out put 55
>>
>> in debugging val & *ptr are showing 55 only,
>> but while printing val it is showing '0' as out put
>> while printing *ptr it is showing '55' as out put
>>
>> what is the problem, i am unable to get could u pls help me out.
>
> repeat with me:
> const very ugly;

bool, _bool, _Bool BOOL very very very ugly

> private protected friend template, ugly;

don't know for template, and friend

0 new messages