Hi everyone, I looked at the FAQ a couple of times and could not find anything on this, and I figured someone on here could help.
I am making a hangman game in C (just for learning purposes) and would like to create a database of words for the computer to select randomly in order to allow the user to play multiple times. I figured the best way to do this was to make a two dimensional array with one dimension being the word itself, and the other being the string of letters that make up the word. I would like to know if there is an easy way to assign the string to the first dimention without having to create a new line for each letter.
For example:I don't want to do this
I want to do something more like:Code:char pass1; pass1 ='a'; pass1 ='l'; pass1 ='f'; pass1 ='t'; pass1 ='r'; ...
Code:char pass1 ; pass1 ="alf"; pass1 ="tree";
What is the correct syntax for this?