473,698 Members | 2,403 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can I access functions within another C program?

2 New Member
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 1841
horace1
1,510 Recognized Expert Top Contributor
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 New Member
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
3340
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 charcters in it, that the code needs to run until all bad characters are gone? For example, if a file has the name "<bad*mac\file" the program has to run 3 times to get all three bad chars out of the file name. The passes look like this:
47
3865
by: Richard Hayden | last post by:
Hi, I have the following code: /******************************** file1.c #include <iostream> extern void dummy(); inline int testfunc() {
7
2127
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 reasons we must move to SQL Server right away. Based on our configuration, we're hoping someone can give us a feel for what's involved here. Since we're only using Access for the data we're not sure what an "upsizing" would entail. Can someone point us...
5
1776
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
1857
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 and will additionally have the following functions on it: Print, Save (CSV), Import (CSV). 3. On top of that the program will function - solely as a stand-alone program. I want to be able to modify the fields from within Access and for
7
4195
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 code for 6 hours and stops. I've found the problem to be the Set MySession = CreateObject("MAPI.Session")
1
2032
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 disappeared even though his website still functions. As the program requires updating, I was wondering whether anyone has any suggestions, as to what I should do. The program allows you to search a public database called PubMed. You can mark abstracts...
11
6593
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 where the job is running, the job runs sucessfully, PDF files got generated, everything is good. If I scheduled the job to run at the time that I am not logged into the server, Access is not able to print to the printer. The error is pretty...
5
2687
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 that's come before. To take an extreme example, suppose you have been writing Visual Basic applications for years now. If you're like many developers, you will have built up a substantial inventory of code in that time. And if you've been following...
0
8680
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9169
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9030
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8899
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7738
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5861
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2335
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.