Jump to content
Hostul a fost schimbat. Daca vedeti serverul offline readaugati rpg.b-zone.ro sau 141.95.124.78:7777 in clientul de sa-mp ×

[PASCAL] Informatică Clasa a X-a - Capitolul #1 (Subprograme) - Lecţia 1.2.3.1


Leventhe
 Share

Recommended Posts

1.2.3.1. Structura subprogramelor de tip functie

In figura urmatoare este prezentata structura antetului:

 

Fse3No6.png

 

Exemplu:

function suma(x,y:integer):real;
begin
 suma:=x+y;
end

-Antetul este "function suma(x,y:integer):real;";

-Identificatorul (numele) functiei este suma. Lista parametrilor formali este "x,y:integer". Functia este de tip real (identificatorul de tip);

-Blocul este (in acest caz lipsesc variabilele locale);

begin
 suma:=x+y;
end 

Important: identificatorul de tip (tipul valorii intoarse de functie) poate fi: de orice tip ordinal, de orice tip real, de orice tip pointer sau de tipul string (acest tip va fi studiat in curand).

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.