When to define functions in C?


 
Thread Tools Search this Thread
Top Forums Programming When to define functions in C?
# 8  
Old 03-31-2014
If you had to compile all of stdio whenever you did #include <stdio.h>, for example, that would be a real pain. But instead, it can just include a lot of definition-less declarations, and let you find the functions inside a library file when it gets linked.

It also lets someone give you a library file without necessarily giving you the code that made it(though inevitably system-specific).
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Define Variables

Hi, I just define the variable in script and use those script in another script but the variable not recognize. test1.sh #!/bin/bash DB="test_db" USR="test_user" PWD="test_pwd" HST="24.254.87.12" test2.sh #!/bin/bash ./test1.sh mysql -u $USR -p $PWD -h $HST... (2 Replies)
Discussion started by: fspalero
2 Replies

2. Shell Programming and Scripting

Define variable from file.

HI I have file A.txt _1A _2A _3A _4A I want define all as different variable. $1A=_1A $2B=_2A $3C=_3A $4D=_4A Now i can use any variable in my script. (3 Replies)
Discussion started by: pareshkp
3 Replies

3. Shell Programming and Scripting

How to execute functions or initiate functions as command line parameters for below requirement?

I have 7 functions those need to be executed as command line inputs, I tried with below code it’s not executing function. If I run the ./script 2 then fun2 should execute , how to initiate that function I tried case and if else also, how to initiate function from command line if then... (8 Replies)
Discussion started by: saku
8 Replies

4. Programming

#define in c

Hi, I had a head file, looks like #define MIN_NUM 10 #define MAX_NUM 10 is there any way to get "MAX_NUM" from 10? thanks. peter (9 Replies)
Discussion started by: laopi
9 Replies

5. Programming

help with #define in C

if i do this in C #define NUM 1234512345 then how come i cant print it out using int main(int argc, char **argv) { printf("%d\n", NUM); return 0; } well the result is -1219236538, why isnt it 1234512345 ? (7 Replies)
Discussion started by: omega666
7 Replies

6. Programming

#define

Hello, I would like to conditionaly comment in my code source some fields from arrays. So I use the property ## from the #define definition. my code: ... #define slet /##* #define etsl *##/ ... const T_SVT_ADLL_A653_DESC A_DESC = { { slet qwerty etsl SLICING,... (3 Replies)
Discussion started by: cypleen
3 Replies

7. UNIX for Dummies Questions & Answers

#define in perl

Hi friends, I am not sure if perl questions can be raised here. :rolleyes: But I have a doubt if there is a way to do "#define" in perl, like in C. Does anyone know if it is feasible (without CPAN modules)? Thanks, Srini (7 Replies)
Discussion started by: srinivasan_85
7 Replies

8. Programming

mysterious #define

in the header file orville.h, outside of the #ifdef #endif , there is the following #define JOB_CONTROL /* support job-control */ As you can see, the JOB_CONTROL macro has no value associated with it. Here is what I go when I ran grep on the entire source code. $ grep -iR... (6 Replies)
Discussion started by: frequency8
6 Replies
Login or Register to Ask a Question
DwtFetchInterfaceModule(3Dwt)											     DwtFetchInterfaceModule(3Dwt)

Name
       DwtFetchInterfaceModule - Fetches all the widgets defined in an interface module in the UID hierarchy.

Syntax
       #include <X11/DwtAppl.h>
       Cardinal DwtFetchInterfaceModule(hierarchy_id, module_name,
					parent_widget, widget_return)
	    DRMHierarchy hierarchy_id;
	    char *module_name;
	    Widget parent_widget;
	    Widget *widget_return;

Arguments
       hierarchy_id
		 Specifies  the  ID of the UID hierarchy that contains the interface definition.  The hierarchy_id was returned in a previous call
		 to DwtOpenHierarchy.

       module_name
		 Specifies the name of the interface module, which you specified in the UIL module header.  By convention,  this  is  usually  the
		 generic name of the application.

       parent_widget
		 Specifies the parent widget ID for the topmost widgets being fetched from the module.	The topmost widgets are those that have no
		 parents specified in the UIL module.  The parent widget is usually the top-level widget returned by XtInitialize.

       widget_return
		 Returns the widget ID for the last main window widget encountered in the UIL module, or NULL if no main window widget is found.

Description
       The DwtFetchInterfaceModule function fetches all the widgets defined in a UIL module in the UID hierarchy.  Typically, each application has
       one  or	more  modules  that  define  its interface.  Each must be fetched in order to initialize all the widgets the application requires.
       Applications do not need to define all their widgets in a single module.

       If the module defines a main window widget, DwtFetchInterfaceModule returns its widget ID.  If no main window widget is	contained  in  the
       module, DwtFetchInterfaceModule returns NULL and no widgets are realized.

       The application can obtain the IDs of widgets other than the main window widget by using creation callbacks.

Return Values
       This function returns one of these status return constants:

       DRMSuccess	 The   function   executed
			 successfully.
       DRMFailure	 The function failed.
       DRMNotFound	 The interface	module	or
			 topmost widget not found.

														     DwtFetchInterfaceModule(3Dwt)