Reputation: 3 Apprentice
- Active Members
- Active Posts:
- 68 (0.05 per day)
- 17-February 10
- Profile Views:
- Last Active:
- Oct 14 2012 08:11 AM
- Dream Kudos:
Posts I've Made
Posted 11 Oct 2012you can do scanf
you can use your getchar() to store the value from your screen to a variable(or you don't have to do that at all, just check the getchar() return) and if you find "C"from the value, then you return immediately otherwise you keep on going.
Posted 11 Oct 2012you can print as many number as you want! if you can print 1 and 0 what makes you think you can't print -11000 or 110030? just do a return of whatever number on whatever condition you need. since... you did not explain at what condition do you return 1 and when do you return 0, this is the best i can tell you.
Posted 3 Oct 2012nvm, other algo works just as well.
Posted 3 Oct 2012How will storing the variable type help determine if the list is getting too long?
polymorphic type like void * doesn't set the data type to anything but, well, "void *" and "void *" can be anything. so that means after you cast the item type into void you can cast it back into anything you want. "like a philosopher stone!, except its a fake one, its only for the looks". anyway i digress. for example, initially you have a integer pointer called "intPtr" you cast it into a void *, then you put it into a container struct, without knowing the item type beforehand you would never know what type of variable it is. you may cast it to char * or whatever you want, but by doing so you may lose data, not to mention that sometimes incompatible type will cause errors if you try to dereference it improperly, in the otherword, if you don't know what data type void * is beforehand, you will almost definitely eat errors when you try to run the program.
Posted 3 Oct 2012-1 because the OP specifically asked for:
Quoteim kind of stuck on how to set up user input
printf() isn't going to help get any input (unless you call printing out prompts).
he obviously doesn't understand what the code is doing. so i thought he should use print off to familiarize it first, but yes, i didn't hit the mark.
- Member Title:
- D.I.C Head
- Age Unknown
- Birthday Unknown
obviousninja hasn't added any friends yet.