Skip to Main Content
Introduction to Computational Modeling Using C and Open-Source Tools
book

Introduction to Computational Modeling Using C and Open-Source Tools

by Jose M. Garrido
November 2013
Intermediate to advanced content levelIntermediate to advanced
461 pages
12h 1m
English
CRC Press
Content preview from Introduction to Computational Modeling Using C and Open-Source Tools
34 Introduction to Computational Modeling
Every argument in the function call must be consistent with the corresponding
parameter declaration in the function definition. The following example shows the
definition of function squared that includes one parameter declaration, p, and returns
the value of local variable, res.
double squared (double p) {
double res;
res = p
*
p;
return res;
}
Listing 3.1 shows a short but complete program in C. Line 7 is the function
prototype for function squared and the function is called in line 14 with argument
x. The function definition of this function has only one parameter declaration, so the
function is called with one argument. It computes the square of the argument value,
which is the value of variable x and is used as ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Computer Fundamentals and Programming in C (RMK)

Computer Fundamentals and Programming in C (RMK)

Anita Goel, Ajay Mittal

Publisher Resources

ISBN: 9781482216783