Is there a shorter way for this: int sum(int a, int b)? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

Is there a shorter way for this: int sum(int a, int b)?

So, this doesn't work: int sum(int a,b); 😐 I always prefere the shortest way. Maybe some C experts can give me some pro Tipps for shorten code? Thanks

25th Sep 2018, 9:32 AM
BraveHornet
BraveHornet - avatar
1 Réponse
+ 1
If I have many functions similar to the function below, I would make something like this; struct values { int x,y; }; int sum (values v); Edit: If you don't have many of this, as I know the shortest way is int sum (int x, int y); (as you said in the title)
25th Sep 2018, 10:11 AM
Mustafa K.
Mustafa K. - avatar