+ 1

The use of void function is easy than in the place of class and object???

The use of class and object is complicated .so, in the place of class and object can we use void function ,it is easy than class and object

1st Sep 2021, 3:51 PM
Shruti Shukla
Shruti Shukla - avatar
7 ответов
+ 2
Class and objects is a part of object oriented programming . which provides a lots of functionality like data abstraction data hiding and much more but these things you can not do in c you can not hide your data . So dont compare with function to class . What actually you want to achieve with void function.
1st Sep 2021, 3:56 PM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 1
A.S. so, we can't use data abstraction and data hiding etc without class ??
1st Sep 2021, 4:44 PM
Shruti Shukla
Shruti Shukla - avatar
+ 1
Shruti Shukla no only class providing these concepts . First learn basics of function then structure . Structure is similar to class but structure have some limitations then move to oops you will understood much better but first you should start you can learn c or cpp
1st Sep 2021, 6:44 PM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 1
Rishi Im talking about values nothing more
2nd Sep 2021, 11:42 AM
Manvendra Yadav
Manvendra Yadav - avatar
0
Through class u can contruct or return something and through void u can return anything To be very honest U can't skip Try a real world app or problem u will get my point Like when you going to learn flutter the whole framework is depends on widget - object And classes
2nd Sep 2021, 4:38 AM
Manvendra Yadav
Manvendra Yadav - avatar
0
Manvendra Yadav 😒 We can't return anything using void as the return type. Maybe you're talking about returning a void pointer. Then yeah, we can return any type of pointer using a void pointer as the return type. but still, you can only return any type of pointers, not "anything" ;)
2nd Sep 2021, 11:12 AM
Rishi
Rishi - avatar