Thursday, February 7, 2008

Input/Output

As the control arrays still remain unsolved, I have met another problem when converting the code. The very first thing is input and output format. As I want the user to enter the numbers into textboxes, I was trying to find a code to convert all those variables. The first thing is, when I use AfxMessageBox, I can't do the same things I could with "cout". For example the line
cout << "cell(" <<>
would just give me huge error in AfxMessageBox. It says me that the first parameter should be a string value for this function. So I decided to put everything into another string variable before calling the function:
outString="cell("+(i+1)+","...."\n"

But then I find that I also need to convert the number into a string before that:
_itoa(i+1,buffer,10);

And then I find out that it doesn't convert it exactly into the type of string I want it to be converted into. So I have to use this:
...+(Char::ToString(buffer))+...

This is what the tutorial told me. But. The tutorial says I would need using namespace System for that, but my compiler doesn't like it at all. So I'm kind of stuck here.
Actually I don't really need this, as I'm going to output everything in the same textboxes on the form, but anyways, how would I do that if I needed to?
I'm going to do more research on strings.

1 comment:

GeekTeach said...

Whew... it is difficult.

Can you use your C code as part of a JAVA application to make the input/output graphical?

An alternate is using VB.NET which accepts different languages, but I am not sure about its use of C and C++ modules directly

~Richard.