Okay but then it instantly goes into an infinite loop....... he needs to make it meaningful by allowing the "i" variable to change in his loop, as your nice for loop shows.
Type: Posts; User: gratiafide
Okay but then it instantly goes into an infinite loop....... he needs to make it meaningful by allowing the "i" variable to change in his loop, as your nice for loop shows.
You also need to initialize your "i" variable to a value of your choice before it starts testing its value in the while loop condition (i>o), but i is not defined at this point as anything meaningful.
You need to do make your "i" variable in your while loop change every time you put a new number in it. Then, when you are trying to print your array out backwards, you need another similar while...
hmmm I'm still getting errors trying to compile this guy's code.
C:\Program Files (x86)\PellesC\Projects\game\main.c(36): warning #2027: Missing prototype for 'getch'.
C:\Program Files...
What does srand do? I get errors from it and can't compile the code.
This sounds like a fun assignment, quite frankly.
You should post some of this information so we can see how it might be adjusted to include hidden data.
My final code for your programming delight:
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
int main()
{
char ch;
Both my codes were okay as long as I hit enter first, and then hit ctrl-Z
Uh, actually is doesn't. I have to hit enter and THEN control-z.
I appreciate the help guys, but one strange thing is that this similar loop (that I also wrote for another problem) works okay with the EOF as far as I can tell.
#include <stdio.h>
#include...
Why can't I hit ctrl-Z just once to exit from my while loop?
The first time I hit ctrl-Z, my debugger says it has a value of ASCII 32, or a blank space.
If I hit ctrl-Z twice in a row, then...
ok, now \\n seems to be working. i swear it wasn't a second ago.
How do I print "\n" or "\t"? Apparently neither \n nor \\n work.
:mad::mad::mad::mad::mad:
Would it work to do a loop that continually adds itself up by 1 until it reaches the first & largest digit of the array, and then adds itself up until it reaches the 2nd digit of the array, and then...
I suspected something like this... I was hoping to not have to manually enter all 31 entries though in a giant switch statement. Thanks!
Is there a way to print the control characters (0 to 31 decimal in ASCII) so that you can actually see the control character on the output screen? I'm talking about the "upwards carrot" and the...
I really appreciate all the effort put into these posts. I keep thinking there is an easy way to do these things and it usually seems it is not so easy. It will take me a while to digest all this...
Ignore my wrong equals sign. tester==0
How about this?
float num_check (int tester, float num_entd)
{
while((num_entd>1000) || (num_entd<0) || tester=0)
{
printf("Please enter a valid weight between 0...
I am sending in a float value though. Are you saying I can just get rid of the (float num_entd) even though I'm sending in a float?
Unfortunately, I don't yet know any of those commands :(
What can I add to my function that will make sure only numerical input is added? This is not for homework.
float num_check (float num_entd)
{
while((num_entd>1000) || (num_entd<0))
...
I think Nominal's point is that there are times where C or C++ are better situated for a project, and he also is saying that you probably could do a great many projects in either C or C++ equally...
Thanks - yeah, Australia might be a bit too far away for me. I live in Mississippi, and I didn't even want to pursue a position in Atlanta!
That was really well written, Nominal Animal. I thought it was interesting that you mentioned the open-source issue as a contrast between the two languages. It reminded me of the movie Tron. They...