Conversion from c++ to C#

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Sir,

I am trying to port my c++ code which i have written in evc++ for
pocket
pc. I want to port it VisualC# application.

But i am facing problem in converting.

fscanf(file, "%d %d",&(gd.edges.vert1), &(gd.edges.vert2));

is ther any alter native for it in C#

Regards

Naveen
 
You asked this a week or so ago, and the answer has not changed. There is
no equivalent in managed code. You're going to have to come up with a
different mechanism. A TextWriter is probably the simplest mechanism using
the ToString function on the numeric variables.

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate
 
that is wht i wan to know how can i use text class . i read text calss but
unable to get wht to and how to.

regards

naveen
Chris Tacke said:
You asked this a week or so ago, and the answer has not changed. There is
no equivalent in managed code. You're going to have to come up with a
different mechanism. A TextWriter is probably the simplest mechanism using
the ToString function on the numeric variables.

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


Naveen koul said:
Sir,

I am trying to port my c++ code which i have written in evc++ for
pocket
pc. I want to port it VisualC# application.

But i am facing problem in converting.

fscanf(file, "%d %d",&(gd.edges.vert1), &(gd.edges.vert2));

is ther any alter native for it in C#

Regards

Naveen

 
Try this:

using(StreamReader sr = File.OpenText("yourfile"))
{
while (sr.Peek() > 0)
{
string [] l = sr.ReadLine().Split(' ');
if (l.Length != 2) continue;

int vert1 = Convert.ToInt32(l[0]);
int vert2 = Convert.ToInt32(l[1]);
}

}
 
Show us the failing code and tell us the failure mode.

-Chris


Naveen koul said:
that is wht i wan to know how can i use text class . i read text calss but
unable to get wht to and how to.

regards

naveen
Chris Tacke said:
You asked this a week or so ago, and the answer has not changed. There
is
no equivalent in managed code. You're going to have to come up with a
different mechanism. A TextWriter is probably the simplest mechanism
using
the ToString function on the numeric variables.

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


Naveen koul said:
Sir,

I am trying to port my c++ code which i have written in evc++ for
pocket
pc. I want to port it VisualC# application.

But i am facing problem in converting.

fscanf(file, "%d %d",&(gd.edges.vert1), &(gd.edges.vert2));

is ther any alter native for it in C#

Regards

Naveen

 
Back
Top