• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About Liam78

  • Rank
  1. thx for the helps guys, one last thing how do i insert code blocks in the forums,,, is it something like <code> example code here </code>
  2. The following piece of code works if the user enters an interger, but... How can i make it so the program will not crash when a user enters a char? for example the user enters "g" and instead of crashing it displays "invalid choice pick again" int validation(void) { int menu_choice; while(1) { cin >> menu_choice; if(menu_choice == 1 || menu_choice == 2 || menu_choice == 3) { return(menu_choice); } else { cout<<"invalid choice pick again "; } } }
  3. thankyou cocalus and roboguy, both the c++ and c examples work, i guess i will try and move onto using the c++ commands when it comes to strings, cheers guys
  4. Can any1 help me with the following problem in c / c++ i have... I have an array set up as follows: char *animals[] = {"cat","dog","mouse","elephant,"rhino","snake","fish"}; How can i store the string "rhino" in a variable using the following reference to rhino: animals[4][0]; i have tried something like the following, char hold_word[100] = *animals[1][0]; but it does not seem to work? i will get the error message: "invalid initializer" i would want hold_word to hold the value "rhino" if that is possible.
  5. thankyou for the quick responses people, appreciated Li
  6. hi all I was wondering if there is a way to find out the length of an array in c or c++ for example: char *animals[] = {"cat", "dog", "mouse", "elephant, "rhino", "snake", "fish"}; is there a function that would return to me the number of animals that are stored in this array? In flash for example it would be something like: int num_of_animals = animals.length(); ======================================================== ALso is there a way i can find all the functions that my complier has? for example: printf() scanf() etc,,, will it be in a help file?! i am using bloodched Dev-C++ thx Li
  7. Flash Action script: Real simple issue....

    hi kid4today Although i know AS quite well it has been a year or so since i have touched it so bare with me if u can :) ok first the syntax you are using seems correct, so i am guessing it might be 1 of 2 things: 1) Your pathways are incorrect, 2) It is going to the frame you want but it is going so fast you are not seeing it. Try sticking gotoAndStop("scene 2",2); Just to see if it is actually going to the frame you want. If that does not work then i am thinking is is the pathways, for example the scene you are going to is embedded within another movieclip, therefore you are trying to play the wrong timeline, try something like _root.gotoAndPlay("scene 2",2); hope this helps any liam
  • Advertisement