Well, thanks a lot. I find it working now. Huh, I'm feeling preety stupid now. It must've been very easy to figure out, lol.
Anyway, thanks. Yeah, using string is much better.
Type: Posts; User: wen_wen_dy
Well, thanks a lot. I find it working now. Huh, I'm feeling preety stupid now. It must've been very easy to figure out, lol.
Anyway, thanks. Yeah, using string is much better.
Could you show me how to allocate memory and copy it? I've tried to allocate memory using:
char *res = new char;
and copying it into the array using strcpy:
I'm having problem with my program here. See, I have an array of char* as data member in Action class. With the help of getFirst() function, I'm returning the value of the first element in the array....
Whoa?? How come??
It really works in my computer... I don't know about it... I'm using devC++ and Quincy for compiling, and they give me the same result: it works!!
Mmmm, after all, I think you...
Mmmm??
Replace this line at line 9:
printf("%c\n", Number);
Replace it with an error message like this:
Hey, what do you intend to do with this line??
if(ifp & ofp)
Shouldn't it be an expression?? Not only the variable's name....
How about this?
Mmmm, you never uses do-while loop, do you?
Do and while should always be in pair in do-while loop. You need read some reference.
OK... This line:
do-while loop{
Should be replaced by:
Your AND operator is should be &&, not &, I think...
Yes, to get floating point number, put the temp variable into float data type.
And then, I think you should change the second expression within the for loop. I think it should be i <= 100, not i...
Don't worry... There is nothing to do with your %c. Doesn't matter whether you put %c or %8c. It still works! Don't worry! That's not the mistake of your program... Do you understand my previous...
Hey! How could you say that it doesn't work?? It works, really. Though, you still have to make it tidier...
It works for the first question, but when we enter a number for the second time, it...
Hello,
You should use integer data type for number. Otherwise, it wouldn't be able to be converted to character using %c. So, use int Number and replace all %g with %d for integer. OK?
Hmm,...
Hey, hey... You cannot use two expression within the while loop's brackets. Remember the syntax for while loop:
while(expression)
{
statements;
}
In order to convert decimal ASCII code to their correspondent character, you can use special character:
\ddd
ddd is the ASCII code in octal number format (base-8 number)
To print it, simply...
Instead of using getchar(), there is another way to make the program stop before quitting and wait for the user to type anykey.
The answer is... using : system("pause"); at the end of your code.
...