|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
![]() |
|
#2
|
||||
|
||||
|
Tell us what is your lecturer's name and email address is then we might be able to offer some help!
|
|
#3
|
||||
|
||||
|
Certainly. Start working on it as soon as you can. Refer back to your lecture notes and the textbook to ensure that you understand the concepts. Apply the "divide and conquer" approach of dividing the large task into several small tasks, each of which is relatively easy to do. In order to accomplish that, you may look at the entire task at a higher, more abstract level so that you can identify functional sections and the flow of data between them (that will both help to identify what those functional sections will need to do as well as the form/format of the data at each stage).
If you have specific questions about specific problems that you encounter (ie, no more of this plopping the entire assignment in our laps and expecting us to jump eagerly at doing your homework for you), then post such specific questions and we will try to help you. In case it hasn't sunk in yet: we do not do your homework for you. In fact, teachers have started visiting our forum looking for their students who have plopped the entire assignment in our laps wanting us to do their homework for them. So then turn to, laddie! Lay yer back into it! |
|
#4
|
||||
|
||||
|
Well, we could be generous and give him/her a little headstart:
Code:
#include <stdio.h>
typedef struct {
int ch;
int count;
} star_t;
int main(void) {
star_t foo[] = {
{32, 21}, {47, 1}, {34, 1}, {92, 1}, {'\n', 1},
{32, 20}, {124, 1}, {92, 1}, {46, 1}, {47, 1}, {124, 1}, {'\n', 1},
{32, 20}, {124, 1}, {32, 3}, {124, 1}, {'\n', 1},
{32, 20}, {124, 1}, {32, 3}, {124, 1}, {'\n', 1},
{32, 20}, {124, 1}, {62, 1}, {126, 1}, {60, 1}, {124, 1}, {'\n', 1},
{32, 20}, {124, 1}, {32, 3}, {124, 1}, {'\n', 1},
{32, 17}, {47, 1}, {39, 1}, {92, 1}, {124, 1}, {32, 3}, {124, 1}, {47, 1}, {39, 1}, {92, 1}, {46, 2}, {'\n', 1},
{32, 13}, {47, 1}, {126, 1}, {92, 1}, {124, 1}, {32, 3}, {124, 1}, {32, 3}, {124, 1}, {32, 3}, {124, 1}, {32, 1}, {92, 1}, {'\n', 1},
{32, 12}, {124, 1}, {32, 3}, {61, 1}, {91, 1}, {64, 1}, {93, 1}, {61, 1}, {32, 3}, {124, 1}, {32, 3}, {124, 1}, {32, 2}, {92, 1}, {'\n', 1},
{32, 12}, {124, 1}, {32, 3}, {124, 1}, {32, 3}, {124, 1}, {32, 3}, {124, 1}, {32, 3}, {124, 1}, {32, 3}, {92, 1}, {'\n', 1},
{32, 12}, {124, 1}, {32, 1}, {126, 1}, {32, 3}, {126, 1}, {32, 3}, {126, 1}, {32, 3}, {126, 1}, {32, 1}, {124, 1}, {96, 1}, {32, 3}, {41, 1}, {'\n', 1},
{32, 12}, {124, 1}, {32, 19}, {47, 1}, {'\n', 1},
{32, 13}, {92, 1}, {32, 17}, {47, 1}, {'\n', 1},
{32, 14}, {92, 1}, {32, 15}, {47, 1}, {'\n', 1},
{32, 15}, {92, 1}, {32, 4}, {95, 5}, {32, 4}, {47, 1}, {'\n', 1},
{32, 16}, {124, 1}, {45, 2}, {47, 2}, {39, 2}, {96, 1}, {92, 1}, {45, 2}, {124, 1}, {'\n', 1},
{32, 16}, {124, 1}, {32, 1}, {40, 2}, {32, 1}, {43, 1}, {61, 2}, {41, 2}, {32, 1}, {124, 1}, {'\n', 1},
{32, 16}, {124, 1}, {45, 2}, {92, 1}, {95, 1}, {124, 1}, {95, 1}, {47, 2}, {45, 2}, {124, 1}, {'\n', 1}
};
int i, j;
for (i = 0; i < sizeof(foo) / sizeof(foo[0]); i++) {
star_t bar = foo[i];
for (j = 0; j < bar.count; j++) {
printf("%c", (char)bar.ch);
}
}
return 0;
}
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by Nyan, lackoblacko and jwdonahue, superior C programmers of the month |
|
#5
|
||||
|
||||
|
By posting your assignment verbatim, you are making it very easy for your tutor to discover your attempt to cheat. It has happened recently. Be warned. You won't get any help on that basis, so your best bet is probably to edit your post and remove the text. You might at least regain some credibility and get more cooperation when you conform to the forums rules.
|
|
#6
|
|||
|
|||
|
thanks for the headstart and all the tips, that's basically what I was looking for, a starting off point. I will make sure not to abuse the forums again and only ask if I have specific questions.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > Packets C Programming Question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|