473,385 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Can I access functions within another C program?

2
Hello!

I am new to this site and very new to C programming.

I am writing a basic GUI in Turbo C which I can do with relative ease.
However, our teacher has given us a C file whichwhen run, can control things on a circuit board. My GUI runs fine, and the the teachers program runs fine aswell.
However, what I want to do is to be able to call functions in his file (e.g. heater_on() ) from within MY C file, but am not sure if this is possible.

I know that to include certain functions in a program one must use header files, but is it possible to use another C program and not a header? I have scoured the web but cannot find an answer!

Thank you for your help and apologies if I'm asking a silly question!

Thanks,

- Wiggy -
Dec 11 '06 #1
2 1827
horace1
1,510 Expert 1GB
there are a number of ways you can do this

(1) copy the source code of the functions you require into the file containing your program

(2) include the c file, e.g. assuming the functions you need are in a file called heater.c
#include "heater.c"

(3) the preferred way: include the header file (assuming your lecturer has provided one), e.g.
#include "heater.h"
and add the header.c file to the project so it is linked to your program when the project is built.

your lecturer should give you some guidance

unless you are thinking of RPC (remote Procedure Call)
http://en.wikipedia.org/wiki/Remote_procedure_call
Dec 11 '06 #2
wiggy
2
Ok, thanks for your help. I shall talk to my lecturer.

Regards.
Dec 11 '06 #3

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

Similar topics

5
by: hokiegal99 | last post by:
A few questions about the following code. How would I "wrap" this in a function, and do I need to? Also, how can I make the code smart enough to realize that when a file has 2 or more bad...
47
by: Richard Hayden | last post by:
Hi, I have the following code: /******************************** file1.c #include <iostream> extern void dummy(); inline int testfunc() {
7
by: Teri Welch | last post by:
Hello, We maintain a VB6 front-end application using an Access 2000 database. All code and forms are in VB6. The program also uses several queries/reports defined in Access. For corporate...
5
by: zqhpnp | last post by:
class String { public: String& operator=(const String& str); private: char* pdata; } String& String::operator=(const String& str) { if(this==&str)
2
by: Jonathan \(Pickles\) Sklan-Willis | last post by:
Hi All, This is what I want to do: 1. Build a database in Access with certain queries and a query form. (DONE). 2. I now need to use the same form as a form in VB, this will be the front page...
7
by: Ottar | last post by:
I've made a program sorting incomming mail in public folder. The function runs every minute by using the form.timer event. In Access XP it runs for weeks, no problem. Access 2003 runs the same...
1
by: gaosul | last post by:
I am non-programming scientist and I am using a Program called Easyarticles from Synaptosoft Inc., which is based the database program Access. Unfortunately, the owner of this company has...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
5
by: Lyle Fairfield | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/callnetfrcom.asp The Joy of Interoperability Sometimes a revolution in programming forces you to abandon all...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.