473,659 Members | 2,836 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

c doubt

hi,
i tried with this simple code
int array[],i;
for(i=-1;i<=sizeof(arr ay);i++)
but the condition is failing always even array size is greater than
zero.
can u help me.............

Apr 5 '07 #1
29 2097
sw************* **@gmail.com wrote:
hi,
i tried with this simple code
int array[],i;
for(i=-1;i<=sizeof(arr ay);i++)
Didn't your compiler warn you about a dimensionless array?
>
but the condition is failing always even array size is greater than
zero.
Think about the result of sizeof, is it a signed or an unsigned type?
can u help me.............
u doesn't post here any more.

--
Ian Collins.
Apr 5 '07 #2
"Ian Collins" wrote
sw************* **@gmail.com wrote:
>hi,
i tried with this simple code
int array[],i;
for(i=-1;i<=sizeof(arr ay);i++)
Didn't your compiler warn you about a dimensionless array?
>>
but the condition is failing always even array size is greater than
zero.

Think about the result of sizeof, is it a signed or an unsigned type?
>can u help me.............
u doesn't post here any more.
Ask two questions, and then instruct not to reply. One wonders
why you bothered. . .

--
Craig Franck
cr**********@ve rizon.net
Cortland, NY
Apr 6 '07 #3
Craig Franck wrote:
"Ian Collins" wrote
>>sw*********** ****@gmail.com wrote:
>>>hi,
i tried with this simple code
int array[],i;
for(i=-1;i<=sizeof(arr ay);i++)

Didn't your compiler warn you about a dimensionless array?
>>>but the condition is failing always even array size is greater than
zero.

Think about the result of sizeof, is it a signed or an unsigned type?
>>>can u help me.............
u doesn't post here any more.

Ask two questions, and then instruct not to reply. One wonders
why you bothered. . .
Pardon? The questions were intended to point the OP in the right
direction. It's often better to hint than to give a direct answer.

I said nothing about not replying. The use of silly abbreviations is
inappropriate on a technical Usenet group.

--
Ian Collins.
Apr 6 '07 #4
On Apr 5, 11:35 pm, "Craig Franck" <craig.fra...@v erizon.netwrote :
"Ian Collins" wrote
swapna.annaman. ..@gmail.com wrote:
hi,
i tried with this simple code
int array[],i;
for(i=-1;i<=sizeof(arr ay);i++)
Didn't your compiler warn you about a dimensionless array?
but the condition is failing always even array size is greater than
zero.
Think about the result of sizeof, is it a signed or an unsigned type?
can u help me.............
u doesn't post here any more.

Ask two questions, and then instruct not to reply. One wonders
why you bothered. . .
Reply to a post without taking the effort of actually reading what you
are responding to. One wonders why you bothered...

Robert Gamble
Apr 6 '07 #5
"Ian Collins" wrote
Craig Franck wrote:
>"Ian Collins" wrote
>>>sw********** *****@gmail.com wrote:
>>>>hi,
i tried with this simple code
int array[],i;
for(i=-1;i<=sizeof(arr ay);i++)

Didn't your compiler warn you about a dimensionless array?

but the condition is failing always even array size is greater than
zero.

Think about the result of sizeof, is it a signed or an unsigned type?

can u help me.............

u doesn't post here any more.

Ask two questions, and then instruct not to reply. One wonders
why you bothered. . .
Pardon? The questions were intended to point the OP in the right
direction. It's often better to hint than to give a direct answer.
That is true, however, subtlety is the last thing one masters
with a language.
I said nothing about not replying. The use of silly abbreviations is
inappropriate on a technical Usenet group.
I'll take your word for it:

"u doesn't post here any more"

tripped me up. Sorry, if I missed the proper intent of continuing
to post.

But it is ironic that abbreviations would be an issue since we are
discussing a language the seems to foster them. The OP might
have thought is was "cool".

Maybe something was lost in translation.

--
Craig Franck
cr**********@ve rizon.net
Cortland, NY
Apr 6 '07 #6
"Robert Gamble" wrote
"Craig Franck" wrote:
>"Ian Collins" wrote
swapna.annaman. ..@gmail.com wrote:
>hi,
i tried with this simple code
int array[],i;
for(i=-1;i<=sizeof(arr ay);i++)
Didn't your compiler warn you about a dimensionless array?
>but the condition is failing always even array size is greater than
zero.
Think about the result of sizeof, is it a signed or an unsigned type?
>can u help me.............
u doesn't post here any more.

Ask two questions, and then instruct not to reply. One wonders
why you bothered. . .

Reply to a post without taking the effort of actually reading what you
are responding to. One wonders why you bothered...
I did read, thoughtfully, which is why I replied precisely as I did.

It is obvious, now, that the poster I replied to did not mean to simply
dismiss the OP as unworthy of posting to this group.

However, again, I got the wrong impression. It seems a question of
whether "hinting" or direct dialogue would be the best approach.

I can only imagine that my confusion was even more pronounced in
the person who made this original post.

--
Craig Franck
cr**********@ve rizon.net
Cortland, NY
Apr 6 '07 #7
Craig Franck wrote:
"Ian Collins" wrote
>>
Pardon? The questions were intended to point the OP in the right
direction. It's often better to hint than to give a direct answer.


That is true, however, subtlety is the last thing one masters
with a language.
Fair point.

--
Ian Collins.
Apr 6 '07 #8
Craig Franck wrote:
"Ian Collins" wrote
>sw************* **@gmail.com wrote:
>>hi,
i tried with this simple code
int array[],i;
for(i=-1;i<=sizeof(arr ay);i++)
Didn't your compiler warn you about a dimensionless array?
>>but the condition is failing always even array size is greater than
zero.
Think about the result of sizeof, is it a signed or an unsigned type?
>>can u help me.............
u doesn't post here any more.

Ask two questions, and then instruct not to reply. One wonders
why you bothered. . .
Where in the world did you dream up "then instruct not to reply"? Could
you please show us which words you claim contain this instruction?
That's two more questions; feel free to reply. And it's true that u
doesn't post here any more. We scared him off.
Apr 6 '07 #9
Craig Franck wrote:
I can only imagine that my confusion was even more pronounced in
the person who made this original post.
I doubt it. I have seen many messages similar to "u doesn't post here
any more." Yours is the first one I have seen in 15 years showing such
a lack of comprehension.
Apr 6 '07 #10

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

Similar topics

1
1995
by: Guilherme Pinto | last post by:
Hello. I am reading the book written by Bjarne Stroustrup called " The C++ Programming Language - Special Edition" and had a doubt which a think is really important to distinguish between the main features of modules, namespaces, and User-Defined types. The text above was copied from page 31. --------------------------------------------------------
138
5214
by: ambika | last post by:
Hello, Am not very good with pointers in C,but I have a small doubt about the way these pointers work.. We all know that in an array say x,x is gonna point to the first element in that array(i.e)it will have the address of the first element.In the the program below am not able to increment the value stored in x,which is the address of the first element.Why am I not able to do that?Afterall 1 is also a hexadecimal number then...
4
2692
by: dam_fool_2003 | last post by:
I am just a beginner in tree data – struct. I have this little doubt. Left node ‘weights' lesser than the right one. I have seen, so far it is algorithm implementations. But why not vice-versa that is right node ‘weights' lesser than the left one? Why the trees are implemented in that way? Can any body clarify? Thanks in advance
20
1646
by: maadhuu | last post by:
firstly, i am thankful to all those who answered the 1st set of doubts. And i am not yet enlightened to that extent , coz ' i keep getting doubts. is the following defined in the language ?? int main() { int a = 1; int *p = &a; p++; printf("%d",*p);
3
1336
by: SMG | last post by:
Hi All, It might be a silly doubt, but it is a doubt.... I am using form authentication for my website, now my web application is gonna be deployed on two web servers with Load Balancing software in place. Now if I login at one place, can I be treated as logged in at other place also or it will again give me a login screen. Form Authentication : Is it internally uses cookies?
77
3666
by: muttaa | last post by:
Hello all, My doubt is going to be so primitive that i ask you all to forgive me beforehand.... Here's the code snippet: int main() { int x=5;
11
2096
by: Bob Nelson | last post by:
I don't remember seeing the term ``doubt'' used much in c.l.c. back in the 90's. When did this word become nearly synonymous with ``question'' or ``query'' and does it have static duration?
122
4238
by: ivan | last post by:
hi all, if I have: if(A && B || C) which operation gets executed first? If I remeber well should be &&, am I correct? thanks
5
1711
by: Paulo | last post by:
Hi, I have a RadioButtonList and I need to do some verifications on a "OnChange" event on client... because on classic asp/html I just add a "onChange" event on <input type="radio" onChange="">, etc... How can it be done on RadioButtonList server component on asp.net 2.0 C# VS 2005 ? Thanks!
0
8427
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
8332
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
8746
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...
0
8627
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...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2750
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
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.