vendredi 12 mars 2021

How to detect how many items are in an array?

Basically, the task on hand is to make a cipher. Encrypted letter's alphabetical position = Unencripted letter + k, where k is an array of letters, corresponding to their alphabetical positions. It cycles through the whole key and loops. However, we are not allowed to use strings. Only char, bool, int, double and arrays are allowed.

I am struggling on the key part. It is given that the key is at most 10 characters long, and k is defined as char k[10]. How do I not loop through the nill parts of the array?

Aucun commentaire:

Enregistrer un commentaire