functinos

closed account (oj2wbRfi)


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  //lets say we have these functions:
 
 void RoadReadData() {}
 void newRoad() {}
 
// what the differnce between these two cases:
 
 1- void newRoad(){
 newRoad->RoadReadData();
 }

 
 
 2- void newRoad() {
 RoadReadData(*newRoad);
 }
Well neither of them compile, so they have that in common.

https://www.sscce.org/
Post a minimum example that shows the full context of your question.

Random lines of code and "what does this do" is always going to be met with
- well it depends...
- clarify the question.
Well,

Line 9 calls a member function of whatever newRoad is.
Line 15 calls a free function that takes a reference/copy of the object newRoad.
Line 15 doesn't call the function defined on line 3, a function with no parameters.

Line 15 calls a function not shown that takes at least one parameter.

This question reads like bad assignment fud.
Last edited on
IMO it reads like a cut-down interview question...
Topic archived. No new replies allowed.