Functions

G a d have the same restrictions as variable names ie

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cu &lt; ada b &lt; ed; ot &lt; d(, ) &lt; nl } Note that function names (e.g. a d have the same restrictions as variable names (i.e. they cannot d) start with a number or special symbol, etc.). Function calling &amp; parameter passing Imagine we made a function for the o e l p c pprogram that checked if the strings overlapped vra.p and a function that determined the length of the overlap: #nld &lt;otem icue isra&gt; #nld &lt;tig icue srn&gt; uignmsaesd sn aepc t; itoelptr(tigs,srn s) n vraSatsrn 1 tig 2 { itsat n tr; frsat=0 sat&lt;s.egh) sat+ o(tr ; tr 1lnt(; tr+) { i(1a(tr)= s.t0) fs.tsat = 2a() { rtr sat eun tr; } } rtr s.egh) eun 1lnt(; } itoelpeghsrn s,srn s,itsat n vraLnt(tig 1 tig 2 n tr) { iti j n ,; fri=sat j=0 ( &lt;s.egh) &amp; ( &lt;s.egh);i+ j+ o( tr, ;i 1lnt() &amp; j 2lnt() +, +) { i(1a()! s.tj) fs.ti = 2a() { bek ra; } } rtr j eun ; } itmi( n an) { srn ipt,ipt; tig nu1 nu2 itsatfvra,lntOOelp n trOOelp eghfvra; cu &lt; &quot;ne frtsrn:&quot; ot &lt; Etr is tig ; gtiecn ipt) eln(i, nu1; cu &...
View Full Document

This note was uploaded on 05/23/2013 for the course CSE 203 taught by Professor Eckroth during the Spring '10 term at Ohio State.

Ask a homework question - tutors are online