M
M
Maxim2014-10-11 07:26:59
Programming
Maxim, 2014-10-11 07:26:59

How does pascal code listing work, or rather one condition?

In this post, a listing of the implementation of the Shannon-Fano algorithm in pascal was given. I just can't understand this little condition.
if (a<>' ') thenWhy are we comparing an array and a character constant equal to space?
Can someone explain how it works, and ideally, show an example in another language in C/C++/C#?
I would be very grateful.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Demidov, 2014-10-11
@Dj_rEPKa

I would venture to suggest that in Pascal, as in C / C ++, strings are arrays of characters, so comparing a character array with a string is quite correct.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question