Forum Replies Created
- AuthorPosts
JonathaThurston
ParticipantYea that makes more sense actually, and its more readable than a for loop.
ThanksJonathaThurston
ParticipantHey dman thanks for explaining it makes more sense now. Is it possible to avoid making *index a pointer to the array and do the manipulations on *w instead?
JonathaThurston
ParticipantAre you using C or C++? If its C the following can help.
123<br />fscanf(fileName, "%d [] %d %d %d %d %d", variableName, arrayName, variableName ...);<br />JonathaThurston
ParticipantYou need to first get the ASCII values for the keys I recomend that you code a simple loop that ask you to enter a key and you print the ASCII value out.
Then use #define to set the values to keys. ie #define ESC 27 and getch() to check whether a key was pressed.JonathaThurston
ParticipantYour assignment is not a very hard one to do, infact it is a fairly standard assignment all you need to do is read carefully at whats asked and implement the code.
Read the following and it will teach you all you need to know to complete the assignment:
http://mycplus.com/tutorials/c-programming-tutorials/basic-dataypes-and-operators-in-c-programming/
http://mycplus.com/tutorials/c-programming-tutorials/file-handling/
http://mycplus.com/tutorials/c-programming-tutorials/arrays/
http://mycplus.com/tutorials/c-programming-tutorials/functions/
http://mycplus.com/tutorials/c-programming-tutorials/loops/Good Luck :)
JonathaThurston
ParticipantHere read http://www.cprogramming.com/tutorial/c/lesson2.html for information on if/else statments, and your if should be
1if(exit == 3) not if(exit = 3e)as what you did assigns 3 to exit.
JonathaThurston
ParticipantWhen your using an if/else statement you can’t give a condition to the else instead you should use else if(condition).
1234567891011<br />if(i != x){<br />...<br />}<br />else if(i == j){<br />...<br />}<br />else(){<br />...<br />}<br />Also your calling int count at the start of the function and again at the start of your do/while loop.
- AuthorPosts