executing code from a file

Posted on 2010-01-08
Medium Priority
Last Modified: 2012-05-08
in public folder there is a source file named copy.c which includes copy function.i want to access public folder with reading mode and run the copy function from copy.c

i am ok with accessing folder and reading the code but i dont have any idea how to execute the function from copy.c...
Question by:Alan Huseyin Kayahan
LVL 12

Expert Comment

ID: 26215159
>>how to execute the function from copy.c...
I am not sure but if your aim is calling a function in copy.c, simply you can include it to your code just as you include header files, and you can reach the function there.

LVL 29

Author Comment

by:Alan Huseyin Kayahan
ID: 26216481
for my project i need to access it with file managment
LVL 32

Expert Comment

ID: 26224554
What platform/OS are you running?

You have a source file named copy.c. This sounds like C-language code for a function that has to be compiled and used by an executable program. Is this correct?

If it is correct, then in your make file or your project, you need to include this copy.c file. You can use the full pathname; then simply call the function that you are interested in from the copy.c file in your program.
LVL 53

Expert Comment

ID: 26272684
>> i need to access it with file managment

What do you mean by that ?

Accepted Solution

HalfAsleep earned 2000 total points
ID: 26275518
The only thing you can do with a c file if you are not compiling it into your application or a dll, is to read it. There is no way for you to read and execute a function described in source code c file. It has to be compiled first.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question