Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7527103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:01:36+00:00 2026-05-30T04:01:36+00:00

I found a C++ code to convert Latitude/Langitude to UTM coordinate. The code is

  • 0

I found a C++ code to convert Latitude/Langitude to UTM coordinate.

The code is here.

I would like to use .NET GUI (windows Forms) instead of the console screen.

Now instead of entering the value 22.2 33.3 for example in console, I would read it from a textBox. and then call the conversion function.

The problem that I faced is I don’t know what parameters should I pass to the function

`CvtLine(int C, char**V, char*p)`

which is called from the main function of console application:

Code

int main(int argc, char**argv){                         //2010-08-11: was void main(...
   char buf[256]; char*p; int L,ac; char*av[129];               //vars for reading stdin
   cout<<setiosflags(ios::fixed);                       //decided against including ios::showpoint
   Fmt=fUT4|fLLD|fLLDM;                             //default for Fmt, if not specified by input
   --argc; ++argv;                              //remove spurious first element of argv array
   while(argc && memcmp(argv[0],"--",2)==0){                    //handle leading options: --Outputformat, --test, --help
      if     (isdigit(argv[0][2]))      Fmt=atoi(argv[0]+2);        //for --<DIGIT>, parse Outputformat into Fmt
      else if(strcmp(argv[0],"--test")==0)  {Testcases(); return 0;}    //for --test, run testcases & exit
      else                  {Usage(); return 0;}        //for --help, show Usage & exit
      --argc; ++argv;
   }
   if(argc==0)  while(cin.getline(buf,256), cin.good()){            //0 args, read stdin converting each line
      p=buf; ac=0;
      while(1){ while(*p&&strchr(" \t",*p))++p; if(*p==0||*p=='#')break; av[ac++]=p; while(*p&&!strchr(" \t#",*p))++p;} //break line into whitespace-separated words
      if(ac>=2&&ac<=4) CvtLine(ac,av,p);                    //line with 2|3|4 words, convert and print
      else if(ac==0)   cout<<buf<<"\n";                     //line with no words, echo the line (comments)
      else             cout<<"==invalid number-of-words: "<<buf<<"\n";      //anything else is invalid, produce errmsg
   }
   else if(argc>=2&&argc<=4)    CvtLine(argc,argv,"");              //2|3|4 args, convert and print
   else             Usage();                    //argc other than 0|2|3 is invalid, show Usage
   return 0;                                    //2010-08-11: added when void became illegal
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T04:01:38+00:00Added an answer on May 30, 2026 at 4:01 am

    Take a look at the .NET Spatial Reference and Projection Engine library.
    http://projnet.codeplex.com/

    .NET Spatial Reference and Projection Engine
    Proj.NET performs point-to-point coordinate conversions between geodetic
    coordinate systems for use in fx. Geographic Information Systems (GIS)
    or GPS applications.

    It their FAQ, there is a code sample on converting between systems.
    Projecting points from one coordinate system to another

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found this code int the net. I need to convert time in to
I found a code samples here: http://sturla.simnet.is/post/2008/09/22/Enable-proxy-in-IE.aspx But it's very complex and involves manipulating
I found some code in a project which looks like that : int main(int
I found the code from the net in which i cant understand this line:-
I found this code from here: http://www.cssportal.com/form-elements/text-box.htm But the problem is you can still
I found this code here class Usable; class Usable_lock { friend class Usable; private:
I write this piece of code with C# using ADO.NET Entity Framework. I found
I've been looking at aurioTouch 2 from Apple' sample code ( found here ).
Hi I found this code on line and cannot convert it over to vb.
I found the code to convert a hexadecimal string into a signed int using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.