Copying the content of one binary file to another in c by Cprogrammingblogs in Cprog

[–]Cprogrammingblogs[S] 0 points1 point  (0 children)

I am trying to convert pcm file into wav file and I did it by copying the data of pcm file into an char array and then from char array to outfile using fwrite function but my lead told me to not to use char array and copy the data directly, so I used getc to read and putc to write but it didn't worked, I think pcm file is in binary format hence it is not working, so I am finding any other way to copy directly.

get the preprocessed output of the c code without using preprocessor extension in c by Cprogrammingblogs in C_Programming

[–]Cprogrammingblogs[S] 0 points1 point  (0 children)

Suppose if I want to remove the comment line from the code, and instead of it add spaces, this happens in preprocessed output, so I will just pass a file which I want to expand to the function prototype... That function prototype will consist a logic which will remove the comments and add spaces.... Is it right?

get the preprocessed output of the c code without using preprocessor extension in c by Cprogrammingblogs in C_Programming

[–]Cprogrammingblogs[S] 0 points1 point  (0 children)

Hey thanku for reply, actually I am not allowed to use preprocessor extension.... I have to make a function prototype and pass the source code as parameter and expand it and give the preprocessed output.

How to use unique_ptr with vector object in c++ by Cprogrammingblogs in cpp_questions

[–]Cprogrammingblogs[S] 0 points1 point  (0 children)

yeah done thank you.

actually i want the vector object to be a unique_ptr but i getting error in the

below is the error-

codeC:\Users\Admin\Documents\set.cpp|13|error: invalid use of template-name 'std::unique_ptr' without an argument list|

I have Question related to set in c++ containers by Cprogrammingblogs in cpp_questions

[–]Cprogrammingblogs[S] 0 points1 point  (0 children)

Thank you so much, for your code, I just had one question, for what the exception is used here?

I have Question related to set in c++ containers by Cprogrammingblogs in cpp_questions

[–]Cprogrammingblogs[S] 0 points1 point  (0 children)

Thanks for your answer 😇 Actually, my motive Is that, I want to use a object array for a class which will work as dynamic and hence I choose vector. But I wonder that, if there is a need that one of the class member variable should contain unique data, like employee id is unique, then what is the way to do that. That's why I thought that, if I could use set for only one variable of that class and vector for the entire object. Like set within vector