+ 1
I was working on little excersize project and I found interesting problem. How would you solve it?
Last week I was practising on my c language skills. I was trying to write a simple program that would be able to open text file and find one choosen word. I know there is many functions with similar effects but I wanted to make that one from scratch. Then I realised many "troublesome treats". The most intriguing: Before I inserted searched word I had to declare char array big enough to provide space for long words. There was a lot of wasted space in case of short word however I could not declare array without precising its size. What would you do in my shoes? Could dynamic arrays help hereor maybe there is any obvious trick that I've missed? Thx for advices.
2 Antworten
+ 6
interesting)) ... try writing a multi-map with a variable string length key and a value being a pointer to the record structure stored in a dynamic array. This is a very interesting challenge.
Requires skills to design a tree - for example, binary, or better red-black.
Skills in implementing functions that mimic OOP classes like in C ++.
Skills of working with dynamic arrays.
C is a cool language - anything is possible.
But the truth is through their work.
🤘😎
+ 3
Maybe you can use the <Arraylist> like in java