473,471 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

questions about c

1 New Member
Hello everybody!! I am new to this forum. i am a student pursuing course in computer in india. Right now I have 3 questions.
1. Files are stored in hdd. then how do we access them using file pointers?
2. why the file pointers are exceptionally written in upper-cases("FILE") ?
3.what result should following code give ?
int i =7;
int j;
j= i++ * i++;
my compiler (TC++ IDE) gives 49. Is it logical? why the increment is not inflicted? Is the result compiler independent?
Nov 22 '06 #1
3 1268
sicarie
4,677 Recognized Expert Moderator Specialist
Hello everybody!! I am new to this forum. i am a student pursuing course in computer in india. Right now I have 3 questions.
1. Files are stored in hdd. then how do we access them using file pointers?
2. why the file pointers are exceptionally written in upper-cases("FILE") ?
3.what result should following code give ?
int i =7;
int j;
j= i++ * i++;
my compiler (TC++ IDE) gives 49. Is it logical? why the increment is not inflicted? Is the result compiler independent?
1. declare the pointer and open the file.
2. because that's what the programmer typed.
3. try running it twice, then try running it with ++i * ++i twice as well, possibly even with ++i * i++. That should lead you to your answer.

What do you think about the first two?
Nov 22 '06 #2
Banfa
9,065 Recognized Expert Moderator Expert
3.what result should following code give ?
int i =7;
int j;
j= i++ * i++;
my compiler (TC++ IDE) gives 49. Is it logical? why the increment is not inflicted? Is the result compiler independent?
The result is undefined behaviour because it attempts to modify the vaule of a variable twice between sequence points.

Undefined behaviour is bad and should be avoided, you do not even have any garuntee that the calculation will produce the same result 2 times in a row.
Nov 22 '06 #3
apv2feb
2 New Member
Answer for your 3rd question.
in c for increement any no, are two ways
++i and i++
postfix, prefix type
you are using postfix so
the increemnts are done after multiplication.
as example check this

int i=7;
int j;
j=i++*i++;
printf("%d\n",j);
printf("%d",i);


out put is

49
8

okay...........
Nov 23 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: softwareengineer2006 | last post by:
All Interview Questions And Answers 10000 Interview Questions And Answers(C,C++,JAVA,DOTNET,Oracle,SAP) I have listed over 10000 interview questions asked in interview/placement test papers for...
0
by: connectrajesh | last post by:
INTERVIEWINFO.NET http://www.interviewinfo.net FREE WEB SITE AND SERVICE FOR JOB SEEKERS /FRESH GRADUATES NO ADVERTISEMENT
2
by: freepdfforjobs | last post by:
Full eBook with 4000 C#, JAVA,.NET and SQL Server Interview questions http://www.questpond.com/SampleInterviewQuestionBook.zip Download the JAVA , .NET and SQL Server interview sheet and rate...
4
by: Drew | last post by:
I posted this to the asp.db group, but it doesn't look like there is much activity on there, also I noticed that there are a bunch of posts on here pertaining to database and asp. Sorry for...
8
by: Krypto | last post by:
Hi, I have used Python for a couple of projects last year and I found it extremely useful. I could write two middle size projects in 2-3 months (part time). Right now I am a bit rusty and trying...
0
by: ramu | last post by:
C# Interview Questions and Answers8 http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers8.html C# Interview Questions and Answers7...
1
by: ramu | last post by:
C# Interview Questions and Answers8 http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers8.html C# Interview Questions and Answers7...
0
by: ramu | last post by:
C# Interview Questions and Answers8 http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers8.html C# Interview Questions and Answers7...
0
by: reema | last post by:
EJB Interview Questions http://interviewdoor.com/technical/EJB-Interview-Questions.htm CSS Interview Questions http://interviewdoor.com/technical/CSS-Interview-Questions.htm C Interview Questions...
0
by: reema | last post by:
EJB Interview Questions http://interviewdoor.com/technical/EJB-Interview-Questions.htm CSS Interview Questions http://interviewdoor.com/technical/CSS-Interview-Questions.htm C Interview Questions...
0
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,...
0
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...
0
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,...
0
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...
1
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...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.