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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:35:41+00:00 2026-06-09T21:35:41+00:00

I have an API function that takes constant char * as an input. I

  • 0

I have an API function that takes constant char * as an input. I have to create a delimited text file which is the input of the function like:

193.875 0.0     0.0     2
193.876 0.0     0.0     2
193.877 0.0     0.0     2
193.878 0.0     0.0     2
193.879 0.0     0.0     2
193.880 0.0     0.0     2
193.881 0.0     0.0     2

the support guy of the software told me that I can create and save every line of this file by using sprintf() so I used it like:

sprintf(wsp,"%.3f\t0.0\t0.0\t%d\n", start_freq, z);

and after putting this line in loop I saved every created wsp in an array of string:

for (int j = 0; j < start; j++){

sprintf(wsp,"%.3f\t0.0\t0.0\t%d\n", start_freq, z);
start_freq = start_freq + 0.001;
wspfile[j] = wsp;

}

now I have a file with the required format but comes in array of string. My question is after creating the array how can I pass this array as a constant char * or how can I convert it to constant char *

  • 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-06-09T21:35:42+00:00Added an answer on June 9, 2026 at 9:35 pm

    You could make wspFile an std::string instead of an array. Then instead of

    wspFile[j]=wsp;
    

    you would have

    wspFile+=wsp;
    

    Then to get the const char* version you would call

    wspFile.c_str();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JavaScript API that has a function x that takes some parameters
I have a function that uses the SharePoint api so the method SPUtility.GetLocalizedString is
I have code that uses Win API function RegSaveKeyEx to save registry entries to
I have a function that uses the Google Blobstore API, and here's a degenerate
We have a moderate size (40-odd function) C API that needs to be called
I have the following function in a PHP script, which returns and API call:
I have an api which takes uni code data as c character array and
I have an LLVM (version 2.7) module with a function that takes a pointer
I have a function that takes a variable number of arguments in C that
I have an api listener script which takes in get parameters. But I seem

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.