Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | Apr 2017 |
Last Sign in: | 12 Weeks Ago, 3 Days Ago |
Questions Answered: | 4870 |
Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Hey Course Hero Tutors! I am working on a computer science assignment in C and I have no idea where to start. I am new to C and totally lost. I have so far found help seeking the x's and other help making all possible combinations of characters, but I can't seem to put them together to put the combinations back into the original string. Can anyone help?
This is the assignment:
Write a program called bin_str.c that completes a binary number. A
binary number is made up of 0's and 1's but the input strings you will receive can also contain 'x''s. An x represents a digit that can be either a 0 or a 1. Your program should display all the possible binary digits that can be formed. For example the string x1x0 could represent either 0100, 0110, 1100, or 1110.
1. Name your executable bin_str.out
2. Your program should accept the binary string as a command line argument
3. You MUST solve this program RECURISIVELY
4. Examples
1../bin_str.out 0110
0110
2../bin_str.out 01x0
0100
0110
3../bin_str.out xx
00
01
10
11
4../bin_str.out 101x100x11x
10101000110
10101000111
10101001110
10101001111
10111000110
10111000111
10111001110
10111001111
Restrictions
• No global variables are allowed
• Your main function may only declare variables and call other functions.
-----------