• Saves Valuable Time
  • Trusted Accuracy for 14 Years
  • 15-Day Money-Back Guarantee

C++ Equivalent to the VB 'Using' Statement

VB C++
Using f As New Foo()
    f.method()
End Using
{
    Foo *f = new Foo();
    f->method();
    delete f;
}

or, if 'Foo' is designed for RAII:

{
    Foo f;
    f.method();
}


Use VB to C++ Converter to convert from VB to C++.     

Additional resource: VB.NET and C++ Equivalents


Copyright © 1997 – 2018 Tangible Software Solutions, Inc.