Is there a shorter way for this: int sum(int a, int b)? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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 Answer
+ 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