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 7368203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:38:09+00:00 2026-05-29T03:38:09+00:00

A function returns a pointer and a length (via the arguments) from an unknown

  • 0

A function returns a pointer and a length (via the arguments) from an unknown DLL.

Result = SpamnEggs( &pBytes, &nBytes )

The pointer points to a valid memory address at which are nBytes sequential bytes.
These bytes contain valid ascci values for text. There is no null termination!

I am tasked with “ovelaying” a string type of some sort in as few simple operations in generic C++ code (without complex libraries or using byte) before output:

cout << sresult

Added:
without copying the bytes as this is a large buffer that must be traversed.

Prototype:

int SpamnEggs( void* pBytes, void* nBytes );

becomes

int SpamnEggs( char** pBytes, int* nBytes );

Many thanks all. Great answers and all very valid.

  • 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-29T03:38:10+00:00Added an answer on May 29, 2026 at 3:38 am

    You can just construct a std::string from the pointer and a length.

    std::string sResult(pBytes, nBytes);
    std::cout << sResult;
    

    (assuming pBytes is a char* pointer, otherwise you need a small cast).

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

Sidebar

Related Questions

I have need for a function pointer that takes two arguments and returns a
The CreateFileMapping function returns a pointer to a memory mapped file, and I want
So, I have a function which returns a pointer to a dynamically allocated double,
I have an array of char pointers of length 175,000. Each pointer points to
uniqid() function returns a 13 digits long hexadecimal number. According to the spec in
PHP's explode function returns an array of strings split on some provided substring. It
WinAPI OpenFile function returns HFILE, and GetFileTime for instance needs HANDLE. When I feed
The Win32 GetTimeZoneInformation function returns your systems local time zone as set up in
The list.index(x) function returns the index in the list of the first item whose
I'm calling a function and adding a listener for when the function returns some

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.