Click here to Skip to main content
16,004,647 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello everyone
I'm just new with interrupt in c/c++. So could anyone help me to solve this problem,please
This is my problem:

How to use interrupt to initiate an empty file "PRIME.INP" that will contain 10,000 numbers in it.

I'm very appreciate your help
Posted
Updated 13-Jul-11 5:29am
v2
Comments
ThatsAlok 13-Jul-11 8:04am    
i doesn't understand meaning of interrupt here!
Sergey Alexandrovich Kryukov 13-Jul-11 16:49pm    
OS, Platform? Without it the question makes no sense at all.
--SA

I suggest you get in touch with your teacher/adviser/tutor and ask for clarification about what he means by "interrupt".

Or have a look in your courses notes, maybe there a reference to that somewhere and will help you doing that task.

anyway, have a look, on msdn, that the following functions :
CreateFile : to create the file.
WriteFile : to write to the file.
CloseHandle : to close the file.

M.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 13-Jul-11 16:52pm    
Exactly. My 5. I'm almost sure OP has not idea what interrupt is. Also, strictly speaking, we should not answer question of platform is not specified.
--SA
Generally speaking interrupt handling isn't available in user code. On the other hand if you are working on a system that allows it (for instance a microcontroller) than you should post here is details, since interrupt handling is system-dependent.
 
Share this answer
 
Comments
ThatsAlok 13-Jul-11 8:45am    
nice somebody here understand interrupts :-)
nguyenle.it 13-Jul-11 9:22am    
I don't know. This is all require from the teacher:
Write a program to create a file that contain 10000 numbers of random prime in the range from 1 to 32767 and put that file name is "PRIME.INP". Use interrupt to initiate an empty file "PRIME.INP", after that, use c/c++ to do the remain features.

Could you give me some ideal for that. Thank for your comment
Maximilien 13-Jul-11 9:51am    
Is it possible that there is something lost in translation ? maybe your teacher want you to create a file with low level functions/api ?
nguyenle.it 13-Jul-11 10:51am    
Create a file with low level function? maybe. SO could you give me some advice for create low level file, please
CPallini 13-Jul-11 11:13am    
If you are using Windows (or Linux or Mac OS X) don't bother about. fulfill well other requirements and just use standard C/C++ library for file access.
On the other hand, I say it again, if you must deal with a system requiring very low level techniques, then, please, let us know about.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900