LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to indicate the cluster data using a single id???

Yes he didn't mention that correctly but logically that's what he meant.

And the ranges are not the point.

Mistakes happen.

0 Kudos
Message 11 of 19
(226 Views)

He is a wonderful teacher.

And these common mistakes happen all the time.

i suggest that you don't lose your hope in your teacher for a small mistake.

He is actually a inventer btw.

0 Kudos
Message 12 of 19
(226 Views)

wiebe@CARYA wrote:

@Yamaeda wrote:

My C++ teacher lost my respect when she claimed you need a 3rd variable to swap two variables.


Why do you say that?  In a text based language, you do need a 3rd variable.  Unless there is some other function built into that language that does the swap.  I would bet that even then, the underlying machine code probably uses a 3rd register to transfer the values.  Please tell me your example of why you claim you would be wrong.

0 Kudos
Message 13 of 19
(220 Views)

@RavensFan wrote:

wiebe@CARYA wrote:

@Yamaeda wrote:

My C++ teacher lost my respect when she claimed you need a 3rd variable to swap two variables.


Why do you say that?  In a text based language, you do need a 3rd variable.  Unless there is some other function built into that language that does the swap.  I would bet that even then, the underlying machine code probably uses a 3rd register to transfer the values.  Please tell me your example of why you claim you would be wrong.


You can do it with pointers.  It has been way too long since I cared about the specifics, but it was essentially just swapping the addresses in a very weird way.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 14 of 19
(218 Views)
Highlighted

We where not talking about compiler internals.

 

Just about user declared variables, and how you need a 3rd.

 

It's fair to say we didn't get along in the first place.

 


@RavensFan wrote:

wiebe@CARYA wrote:

@Yamaeda wrote:

My C++ teacher lost my respect when she claimed you need a 3rd variable to swap two variables.


Why do you say that?  In a text based language, you do need a 3rd variable.  


You don't need one, it's comfortable to use one. There's a difference.

 

Of course there was some conversation first about exactly how utterly impossible it was.

 

Challenge excepted!

 

Spoiler

int a = something;

int b = something;

a = a xor b;

b = a xor b;

a = a xor b;

 

swapped integer values! No 3rd variable!

That proves to me you can most definitely swap to variables without a 3rd.

 

Reluctantly, see said "but that only works for integers"...

 

Spoiler

float a = something;

float b = something;

a = a / b;

b = a * b;

a = b / a;

 

Swapped floats!

She still refused my solution as a possibility, still claiming it was not possible.

 

There's a difference between "not possible" and "not feasible". Refusing to acknowledge the difference invalidates someone as my programming teacher.

 

Message 15 of 19
(213 Views)

Slick.

 

I was visualizing the classic early programming class example of sorting strings like in a bubble sort and swapping them when needed.

0 Kudos
Message 16 of 19
(188 Views)

@Arash_kh wrote:

He is a wonderful teacher.

And these common mistakes happen all the time.

i suggest that you don't lose your hope in your teacher for a small mistake.

He is actually a inventer btw.


Making a mistake is perfectly ok. It's how he'd react to  it.

 

If you point out why the test is confusing (or incomplete), he should say something like: "ah, you're right. I'll fix it for next year". If he responses with: "Bugger off, you're the only one complaining so you must be wrong, stop bugging me", it's a hole other story.

0 Kudos
Message 17 of 19
(153 Views)

wiebe@CARYA wrote:

If you point out why the test is confusing (or incomplete), he should say something like: "ah, you're right. I'll fix it for next year". If he responses with: "Bugger off, you're the only one complaining so you must be wrong, stop bugging me", it's a hole other story.


 "hole other story." LOL

0 Kudos
Message 18 of 19
(138 Views)

@johntrich1971 wrote:

wiebe@CARYA wrote:

If you point out why the test is confusing (or incomplete), he should say something like: "ah, you're right. I'll fix it for next year". If he responses with: "Bugger off, you're the only one complaining so you must be wrong, stop bugging me", it's a hole other story.


 "hole other story." LOL


That one wasn't intentional 😊.

0 Kudos
Message 19 of 19
(133 Views)