Functii C++

Intrebari despre limbajul C++, standardul C++, STL, OOP in C++ sau alte subiecte nelegate de VisualC++
Post Reply
BeatriceB
Junior
Junior
Posts: 4
Joined: 18 Mar 2016, 16:37
Judet: Iaşi

Functii C++

Post by BeatriceB » 18 Mar 2016, 16:42

Ce inseamna si ce returneaza expresia " return (i==1) ? 1 : (a>a[i-1]); " ?



Kavarna
Junior
Junior
Posts: 11
Joined: 20 Sep 2015, 19:14
Judet: Neamţ

Re: Functii C++

Post by Kavarna » 20 Mar 2016, 17:15

" return (i==1) ? 1 : (a>a[i-1]); " ?
Este aproape acelasi lucru ca

Code: Select all

if(i==1)
return true;//Cred ca e o functie bool, asa-i?
else
return a[i] > a[i-1];

BeatriceB
Junior
Junior
Posts: 4
Joined: 18 Mar 2016, 16:37
Judet: Iaşi

Re: Functii C++

Post by BeatriceB » 20 Mar 2016, 20:37

Multumesc ! :D

Post Reply