Recent content by denZer

  1. D

    Programming C The Hangman Game - Array/Strings Help

    So I've ran into an issue, I will have to eventually use an array called "guessed_letters" for now, I am using char user_guesses to store the temporary chars that the user enters. My question is, how can I add their guesses to the array of guessed_letter later on? char...
  2. D

    Programming C The Hangman Game - Array/Strings Help

    I've came across one problem; in the words.txt file, the first string contained is 'store'. However, if the user guesses the character 't', it still shows up as being incorrect while only the letter 's' is the correct one, Here is the function that checks to see if the letter is correct: int...
  3. D

    Programming C The Hangman Game - Array/Strings Help

    You are right, I can only assume that the user doesn't enter the chars longer than the array itself. I don't have to worry about that problem for this project so I'll be fine. The thing is, I want it to read the .txt file so that it knows what the words are. So far, my words.txt file goes...
  4. D

    Programming C The Hangman Game - Array/Strings Help

    I'm well aware of all the Hangman codes that are out there given, but I feel that I will get a better understanding of this project if I did it myself with some help. My main problem is knowing how to compare one character of array from a string text file. The text file consist of a whole...
  5. D

    Using pointers in a User Define Function

    Thank you for everything once again Mark, you've been great! It was definitely a great learning experience for me, and I will be back with another project very soon if I need help!
  6. D

    Using pointers in a User Define Function

    Well Mark, I have to say, that little pointer trivia question you threw at me made everything clear! I am almost done with the program, the only problem I have is when the user wants to play again, it doesn't necessarily go through the whole thing. Here is the code: #include <stdio.h> void...
  7. D

    Using pointers in a User Define Function

    Sorry, I really do find this pointer concept really confusing. After running the program, I see that 5 is stored as the main memory and with *value pointing to it, it multiples it with 2.. If you can give me another pointer question like this, it would be great! Thanks for tutoring me though, I...
  8. D

    Using pointers in a User Define Function

    So what you are saying is that the value will still display 5, however if there was no pointer pointed to main function, it would of displayed 2. (taking into account that there is no pointer anywhere else either)
  9. D

    Using pointers in a User Define Function

    Unfortunately I cannot change the variables :( we have to use as what it is. I am almost done with the program! One problem is that some function like CheckMoney , GetMoney, and GetChange doesn't do what they are intended to do. I believe I have the code somewhere messed up. Here's what I've...
  10. D

    Using pointers in a User Define Function

    Now I've ran to similar problems.. except with doubles this time! //Displays the codes for money input- gets user input amounts //compares the int codes and updates the deposit amount void MoneyMenu(double *bank, double item_cost) { //Money Menu List printf("Please credit your bank...
  11. D

    Using pointers in a User Define Function

    void SetCost(char item, double *item_cost) { double ItemWanted=0; double GamePackagePrice=4.99; double XRayAppPrice=2.99; double EBayAutobidderPrice=7.99; double RestaurantLocatorPrice=1.99; double PhotoEditorPrice=3.99; if(item=='G'||item=='g') {...
  12. D

    Using pointers in a User Define Function

    That definitely helps! I tried printing the price cost and I keep getting either big or negative numbers instead of 4.99. here's what I put: if(item=='G'||item=='g') { *item_cost=GamePackagePrice; printf("The price is %d\n", *item_cost); } I tried changing the * and & around...
  13. D

    Using pointers in a User Define Function

    You're right Mark, it isn't going to set any parameter nor call the SetCost function. My teacher also said that we can't use global variables, we have to fit them in the right user function elsewhere.. I'll figure that out on my own. This is where I'm stuck with the SetCost function, I need...
  14. D

    Using pointers in a User Define Function

    I wish I could but I'm not allowed to add another function. My SetCost function is supposed to sets the cost of the item based on value stored in purchase but I've been staring at the code for an hour and am clueless. Here is what I have now: void DisplayMenu(char *item) { char...
  15. D

    Using pointers in a User Define Function

    Hi guys, I finally had my menu being able to displayed. Now my other problem is getting the cost to be whatever the user wants from the menu. My user function for the code that set's user choice is this: void SetCost(char item, double *item_cost) { //The variable that represents amount of...
Back
Top