473,804 Members | 3,203 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sizeof and increment operators

#include <stdio.h>

int main()
{
int number = 10;
printf("Number is: %d\n", number);

printf("Sizeof of number is: %d\n", sizeof(number++ ));

printf("Number now is: %d\n", number);

return 0;
}
The post-increment operator doesnt seem to work here. The value of the
number remains the same even after the call to the sizeof operator.
Can someone clarify this please?

Thanks,
Anjali.
Nov 14 '05
31 2391
Charles Richmond <ri******@plano .net> scribbled the following:
Anjali M wrote:
#include <stdio.h>

int main()
{
int number = 10;
printf("Number is: %d\n", number);

printf("Sizeof of number is: %d\n", sizeof(number++ ));

printf("Number now is: %d\n", number);

return 0;
}

The post-increment operator doesnt seem to work here. The value of the
number remains the same even after the call to the sizeof operator.
Can someone clarify this please?

What's the matter??? Can't you *do* the job after you
suck it up from the U. S.???


You are incredibly rude. What makes you so sure the OP sucked a job from
the US? What makes you so sure the OP has a job as a programmer at all?
This might just as well be a question from a genuine C newbie. And
besides, even if he did suck up the job from the US, what business is
that of yours? This is a technical newsgroup. If you need to vent your
patriotism, go to a politics newsgroup.

--
/-- Joona Palaste (pa*****@cc.hel sinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"You could take his life and..."
- Mirja Tolsa
Nov 14 '05 #11
>Charles Richmond <ri******@plano .net> wrote in message >news:<40****** *********@plano .net>...

What's the matter??? Can't you *do* the job after you
suck it up from the U. S.???

It seems frm yr language that u hate Indians !!

Did u lost ur job to an Indian, buddy?

Cough up yr technical skills to match-up to ours & take on the
competition instead of making political transgressions on a technical
group like c.l.c!!
Nov 14 '05 #12
ni************* @hotmail.com (Nitin Bhardwaj) wrote:
Charles Richmond <ri******@plano .net> wrote in message >news:<40****** *********@plano .net>...
suck it up from the U. S.???


It seems frm yr language that u hate Indians !!

Did u lost ur job to an Indian, buddy?

Cough up yr technical skills to match-up to ours & take on the
competition instead of making political transgressions on a technical
group like c.l.c!!


Ow! I know the English did some pretty awful things in India, but do you
_have_ to take revenge by murdering their language? Leave that to the
USAnians, like Mr. Richmond ;->

Richard
Nov 14 '05 #13
In <40************ ***@plano.net> Charles Richmond <ri******@plano .net> writes:
Anjali M wrote:

#include <stdio.h>

int main()
{
int number = 10;
printf("Number is: %d\n", number);

printf("Sizeof of number is: %d\n", sizeof(number++ ));

printf("Number now is: %d\n", number);

return 0;
}

The post-increment operator doesnt seem to work here. The value of the
number remains the same even after the call to the sizeof operator.
Can someone clarify this please?

What's the matter??? Can't you *do* the job after you
suck it up from the U. S.???


How many job assignments like this have you seen? This is not only
a newbie question, it is a perfectly legitimate newbie question.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #14
Charles Richmond <ri******@plano .net> wrote in message news:<40******* ********@plano. net>...
Anjali M wrote:

#include <stdio.h>

int main()
{
int number = 10;
printf("Number is: %d\n", number);

printf("Sizeof of number is: %d\n", sizeof(number++ ));

printf("Number now is: %d\n", number);

return 0;
}

The post-increment operator doesnt seem to work here. The value of the
number remains the same even after the call to the sizeof operator.
Can someone clarify this please?

What's the matter??? Can't you *do* the job after you
suck it up from the U. S.???


I don't know what you have got against me. I asked a very valid
question on this newsgroup and I _dont_ have to take this crap from
you. If you can be rude, so can _I_. So, better be careful before you
say something like this again.
Nov 14 '05 #15
Charles Richmond <ri******@plano .net> wrote in message news:<40******* ********@plano. net>...
Anjali M wrote:

#include <stdio.h>

int main()
{
int number = 10;
printf("Number is: %d\n", number);

printf("Sizeof of number is: %d\n", sizeof(number++ ));

printf("Number now is: %d\n", number);

return 0;
}

The post-increment operator doesnt seem to work here. The value of the
number remains the same even after the call to the sizeof operator.
Can someone clarify this please?

What's the matter??? Can't you *do* the job after you
suck it up from the U. S.???


I don't know what you have got against me. I asked a very valid
question on this newsgroup and I _dont_ have to take this crap from
you. If you can be rude, so can _I_. So, better be careful before you
say something like this again.
Nov 14 '05 #16
Charles Richmond <ri******@plano .net> wrote in message news:<40******* ********@plano. net>...
Anjali M wrote:

#include <stdio.h>

int main()
{
int number = 10;
printf("Number is: %d\n", number);

printf("Sizeof of number is: %d\n", sizeof(number++ ));

printf("Number now is: %d\n", number);

return 0;
}

The post-increment operator doesnt seem to work here. The value of the
number remains the same even after the call to the sizeof operator.
Can someone clarify this please?

What's the matter??? Can't you *do* the job after you
suck it up from the U. S.???


I don't know what you have got against me. I asked a very valid
question on this newsgroup and I _dont_ have to take this crap from
you. If you can be rude, so can _I_. So, better be careful before you
say something like this again.
Nov 14 '05 #17
Charles Richmond <ri******@plano .net> wrote in message news:<40******* ********@plano. net>...
Anjali M wrote:

#include <stdio.h>

int main()
{
int number = 10;
printf("Number is: %d\n", number);

printf("Sizeof of number is: %d\n", sizeof(number++ ));

printf("Number now is: %d\n", number);

return 0;
}

The post-increment operator doesnt seem to work here. The value of the
number remains the same even after the call to the sizeof operator.
Can someone clarify this please?

What's the matter??? Can't you *do* the job after you
suck it up from the U. S.???


I don't know what you have got against me. I asked a very valid
question on this newsgroup and I _dont_ have to take this crap from
you. If you can be rude, so can _I_. So, better be careful before you
say something like this again.
Nov 14 '05 #18
Charles Richmond <ri******@plano .net> wrote in message news:<40******* ********@plano. net>...
Anjali M wrote:

#include <stdio.h>

int main()
{
int number = 10;
printf("Number is: %d\n", number);

printf("Sizeof of number is: %d\n", sizeof(number++ ));

printf("Number now is: %d\n", number);

return 0;
}

The post-increment operator doesnt seem to work here. The value of the
number remains the same even after the call to the sizeof operator.
Can someone clarify this please?

What's the matter??? Can't you *do* the job after you
suck it up from the U. S.???


I don't know what you have got against me. I asked a very valid
question on this newsgroup and I _dont_ have to take this crap from
you. If you can be rude, so can _I_. So, better be careful before you
say something like this again.
Nov 14 '05 #19
Charles Richmond <ri******@plano .net> wrote in message news:<40******* ********@plano. net>...
Anjali M wrote:

#include <stdio.h>

int main()
{
int number = 10;
printf("Number is: %d\n", number);

printf("Sizeof of number is: %d\n", sizeof(number++ ));

printf("Number now is: %d\n", number);

return 0;
}

The post-increment operator doesnt seem to work here. The value of the
number remains the same even after the call to the sizeof operator.
Can someone clarify this please?

What's the matter??? Can't you *do* the job after you
suck it up from the U. S.???


I don't know what you have got against me. I asked a very valid
question on this newsgroup and I _dont_ have to take this crap from
you. If you can be rude, so can _I_. So, better be careful before you
say something like this again.
Nov 14 '05 #20

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

Similar topics

70
8919
by: Roy Yao | last post by:
Does it mean "(sizeof(int))* (p)" or "sizeof( (int)(*p) )" ? According to my analysis, operator sizeof, (type) and * have the same precedence, and they combine from right to left. Then this expression should equal to "sizeof( (int)(*p) )", but the compiler does NOT think so. Why? Can anyone help me? Thanks. Best regards. Roy
9
3193
by: Mark Turney | last post by:
I was reading "Practical C++ Programming" yesterday, and it mentioned that the order of execution for post-increment and post-decrement operators was ambiguous. I had previously learned that a post-increment or post-decrement operator modifies the operand once the entire statement has been executed, not during execution of the statement, so this confused me. An examples given to illustrate the ambiguity is: a = i++; // may increment...
42
2418
by: Christopher C. Stacy | last post by:
Some people say sizeof(type) and other say sizeof(variable). Why?
11
3913
by: divya_rathore_ | last post by:
The code: int aaa = 100; printf("%d %d %d\n", --aaa, aaa, aaa--); printf("%d\n", aaa); prints: 99 100 100 98
13
9844
by: jehugaleahsa | last post by:
Hello: In C++, you had to distinguish between post and pre increments when overloading. Could someone give me a short demonstration of how to write these? I get the impression that are handled with the same overload, but I just want to make sure.
3
3044
by: Stang1 | last post by:
The following statement: line_buf = ' '; is equivalent to: line_buf = ' '; line_len++;
0
9708
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9587
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10588
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10340
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5662
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4302
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.