I'm a beginner in C programming and I've got a task that can't finish it..
I'm supposed to generate and print the subsets of a group that its size I should enter. Pointers are not allowed!!
How am I supposed to do it?
I'm a beginner in C programming and I've got a task that can't finish it..
I'm supposed to generate and print the subsets of a group that its size I should enter. Pointers are not allowed!!
How am I supposed to do it?
> How am I supposed to do it?
Well you start with pencil and paper, and make sure you understand the process.
If you can't write out the steps on paper, you can't write a program to do the same thing.
Start small.
All the subsets of 1 element - that should be easy enough
All the subsets of 2 elements
All the subsets of 3 elements
All the subsets of 4 elements (by now, you should be seeing a pattern emerging)
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.