executing code from a file

Posted on 2010-01-08
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

    >>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
    for my project i need to access it with file managment
    LVL 31

    Expert Comment

    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

    >> i need to access it with file managment

    What do you mean by that ?
    LVL 7

    Accepted Solution

    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

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
    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…
    Video by: Grant
    The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
    The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

    755 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

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now