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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:34:04+00:00 2026-05-26T16:34:04+00:00

I’m writing a hobby project wherein I write to .wav files. I decided that

  • 0

I’m writing a hobby project wherein I write to .wav files. I decided that the best way to do this is to create a single C file with a bunch of routines to initialize and manipulate a struct with metadata about the wave file that the user should never manually manipulate, but should instead pass a pointer to routines. An example of how using this interface would look like is the following:

/* wave_new_file() implicitly allocates memory for the struct */
Wavefile *outputWave = wave_new_file("out.wav", WAVE_mono);

int i;
for (i = 0; i < MAX_RANDOM_SAMPLES; i++)
    wave_write(outputWave, rand());

wave_close(outputWave);

I realize that the rest of my design could potentially be simplified in the long-run by using an OOP approach, such as in the following pseudo-C++ (since I’m not actually familiar with C++; more on that later):

Wavefile *outputWave = new Wavefile("out.wav", WAVE_mono);

for (int i = 0; i < MAX_RANDOM_SAMPLES; i++)
    outputWave->write(rand());

outputWave->close(); /* Or delete perhaps? */

The problem with this is that: the rest of my project is written in C99; and I don’t actually know C++ (I learned OOP from Python, but am now concentrating on programming in C).

Should I: refactor my design to not rely heavily on OOP principals or should I take the time and learn C++ and migrate my entire program to C++? It’s not a large program and it is just a hobby project (which explains my reinventing the wheel by making my own .wav writing module). Or should I continue with my pseudo-object-oriented design I currently find myself writing?

  • 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-26T16:34:05+00:00Added an answer on May 26, 2026 at 4:34 pm

    I think it really comes down to your ultimate goals. If you are purely doing this as a hobby and you are developing this for your own use, then you might be happy enough to stick with what you are doing. However, if you are looking not just for a solution but a good solution to a problem, looking for something new, or doing this as preparation for searching for a job, I would move forward with more heavily investing yourself into either C++ or potentially a completely different language like Java.

    Summary in code:

     if(DESIRE_SHORT_TERM_PROJECT_COMPLETION){
          stickWithC = true;
     }else if(DESIRE_KNOWLEDGE_AND_EXPERIENCE_AND_PLAN_TO_DEVELOP_LONG_TERM){
          stickWithC = false;
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I know there's a lot of other questions out there that deal with this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace

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.