freelanceprogrammers.org Forum Index » C
C problem
Joined: 01 Feb 2005
Posts: 2
C problem
why output differs in both statements
-----------------statement 1-----------------------------------
int x;
int y=x++ + ++x +x-- + --x;
output=12
------------------statement 2----------------------------------
int x;
int y;
y=x++ + ++x +x-- + --x;
output=8
---------------------------------------------------------------
Joined: 28 Dec 2004
Posts: 2
C problem
Hi,
First of all x(in first case) and x,y(in second case)
should be initialized to some value otherwise result
will be undefined.
look at this code (where I did some small
modification)
*****************************************
int main(int argc, char* argv[])
{
int x = 0;
int y=x++ + ++x +x-- + --x;
/* int x = 0;
int y = 0;
y=x++ + ++x +x-- + --x; */
printf("%d %d
",y,x);
return 0;
}
****************************End***********
In both cases (comment and uncomment out required test
cases) output is
3,0
regds
vinay
--- krishna_sicsr <krishna_sicsr@...> wrote:
> why output differs in both statements
> -----------------statement
> 1-----------------------------------
> int x;
> int y=x++ + ++x +x-- + --x;
> output=12
> ------------------statement
> 2----------------------------------
> int x;
> int y;
> y=x++ + ++x +x-- + --x;
> output=8
>
---------------------------------------------------------------
>
>
>
>
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo
Joined: 26 Jul 2003
Posts: 4
C problem
> why output differs in both statements
> -----------------statement 1-----------------------------------
> int x;
> int y=x++ + ++x +x-- + --x;
> output=12
> ------------------statement 2----------------------------------
> int x;
> int y;
> y=x++ + ++x +x-- + --x;
> output=8
> ---------------------------------------------------------------
the staements above results into undefined results
plz go thru following link and all the question to undwerstand it better
http://www.eskimo.com/~scs/C-faq/s3.html
hope that helps
-- rajaram
Joined: 02 Feb 2005
Posts: 1
C problem
Hi,i`m a college student.Do u all know how to changed the font and
color of the character?
Joined: 25 Jul 2003
Posts: 48
C problem
Hi,
> -----Original Message-----
> From: JQ [mailto:jqgoh@...]
> Sent: Wednesday, February 02, 2005 9:01 AM
> To: Programmers-Town@yahoogroups.com
> Subject: (PT) C problem
>
> Hi,i`m a college student.Do u all know how to changed the font and
> color of the character?
I might, but it is possible that you are not using the same platform as I
do.
You have to give us more info. What are your:
- Target platform,
- Development tools and version,
- Type of application,
Shyan
Joined: 27 Dec 2004
Posts: 14
C problem
--- Shyan Lam <sflam@...> wrote:
> Hi,
>
> > -----Original Message-----
> > From: JQ [mailto:jqgoh@...]
> > Sent: Wednesday, February 02, 2005 9:01 AM
> > To: Programmers-Town@yahoogroups.com
> > Subject: (PT) C problem
> >
> > Hi,i`m a college student.Do u all know how to
> changed the font and
> > color of the character?
>
> I might, but it is possible that you are not using
> the same platform as I
> do.
>
> You have to give us more info. What are your:
> - Target platform,
> - Development tools and version,
> - Type of application,
>
> Shyan
>
If you are using Turbo/Borland C++ compiler...
then you have to include graphics.h header file...
there are total five fonts available in Turboc
Compiler.
Adn the function for chosing font is settextstyle...
Similarly you can change the colour of your font...
Regards,
Ashwin Mittal.
__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail
Joined: 05 Feb 2005
Posts: 5
C problem
IN what Plateform
--> IN Dos Based
look for function defined in Graphics.h SetTextFont etc.
-->in Win Api
any way if it MFC you can use CFont and it member function i.e. (CreateFont) to create your own font.or you can directly use Win32Api function CreateFont to create your own font and set in the static Ctrl.here is small code listing for your problemCFont fnt;fnt.CreateFont(12,0,0,0,FW_BOLD,FALSE,FALSE,FALSE, DEFAULT_CHARSET,OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY, DEFAULT_PITCH ,"Arial");//now set the font of your controlm_TextWindow.SetFont(&fnt);
-- --- Original Message -----
From: JQ
To: Programmers-Town@yahoogroups.com
Sent: Wednesday, February 02, 2005 8:30 PM
Subject: (PT) C problem
Hi,i`m a college student.Do u all know how to changed the font and color of the character? To unsubscribe : programmers-town-unsubscribe@yahoogroups.com
All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
Booking Calendar - reservation calendar script
Land Surveying - total station instruments and equipments
China Wholesale - Electronics Products
Character Studio - Tutorials and Help
Booking Calendar - reservation calendar script
Land Surveying - total station instruments and equipments
China Wholesale - Electronics Products
Character Studio - Tutorials and Help







