I have 2 char arrays, one with length 50, other whose length varies from 1…50. I need to compare these.
The problem is, that the array containing 50 chars, usually contains less chars, but when comparing, it also takes them into account. So if I have 2 array, whose value is U2, length of first will be 50, the second – 2.
So, how do I check this, without using the standard string library? I must not use the string library, that is a prerequisite.
If you aren’t allowed to use the standard library functionality then your first task is to re-program the required functionality. In your example, this would be
strcmp.Programming this function isn’t difficult – searching online should find you several possible implementations.
Roughly: