You might try usleep() with an incrementing variable to visually time it. You will have to loop it. usleep() uses micro seconds so usleep(1000000) is one second. And you have to #include<unistd.h>.....
Type: Posts; User: gipper
You might try usleep() with an incrementing variable to visually time it. You will have to loop it. usleep() uses micro seconds so usleep(1000000) is one second. And you have to #include<unistd.h>.....
I have had a lot of trouble in the past with 'float'. I would recommend what anduril462 said. Or if you want, it might not hurt tying to use the 'double' variable instead of float. Not completely...
Hahahaha, Thanks.
Ahh, sorry. I completely read that wrong. I was thinking he needed help with something else.
That is putting your number into a char array, then converting it to an integer. (num).
int get_number() {
char buffer[100]; //array that we are going to store the number in.
int num;
fgets(buffer, 100, stdin)
sscanf(buffer, "%d", &num)
return num;
}
This may help.
Ok, that does make sense. Haha just confusing at first.
Well, all I needed is the asterisk. Wow, I don't understand why it was giving me that error.
But it is fixed, Thanks for the help!
I'm getting an error from comparing a character pointer and an integer.
Heres some code.
char *scan_array = &word[0];
char letter;
while(scan_array != letter) // This is the...
What do you mean "find" a program? Are you trying to find someone to write a program for you?
Wow, Thanks sooo much! That sums all of it up.
So where you have "arrayPtr = array;" That will set the pointer to the first element? Wow.. That is way to easy.. Haha
Thanks again! :)
Ok, thanks for the help. I think I should be set.
Thanks so much for the ideas. They will definitely be put to use. But my biggest problem is that I don't know how to declare and initialize the pointers to the array.
Yes, I do realize how easy...
*Number 50. Sorry...
And yes, starting at the INDEX 0, and then incrementing one at a time throughout the array, till I find what I'm looking for, or NULL.
I just need to know what kind of...
To find the actual number 50. And I would like to do it recursively, starting at 0.
Hi, I need to get inside of an array and be able to increment the reference point.
Would I need some kind of pointer?
For example: If I have an array of 100, and I need to access 50,
is there...
I declared letter as a char, and i as an int. The idea was to use i as an index to the array word[].
If 'i' is equal to 0, and i say word[i] then it should access the first letter in the array...
I honestly dont know how I can do that, i do know that i cant compare an integer and a char. Thats what is happening here.
Is there some kind of pointer that i could make to point to the location...
In the class I'm in I was assigned to write hang-man. So in the game I have char word[100] for the word that the user is guessing. And im taking in a single character every time the user guesses a...
A string other than an array? Is that what your saying?
Hello, I know this is a super easy fix, I just cant for the life of me figure it out. I have and array,
word[100];
using an input function (not gets() don't worry) to put lets say 'superman'...