Animated progress bar in C++ | How to simplify or alternatives using strings
Here are some things that may help you improve your program.

Use consistent formatting

The code as posted has inconsistent indentation which makes it a bit harder to read and understand. Pick a style and apply it consistently. 

Think carefully about requirements

You wrote:


  a friend of mine said that this code will have a bad performance because of my use of string, is that true ?


Maybe, but it's important to think about the requirements first before chasing phantoms of imagined performance gains.  The first question is, "does it matter how fast it is?"  I'd say that any code that contains usleeep(50000); within a loop probably isn't performance-critical and so it doesn't much matter.   

So then that leads to the question of what does matter which directly leads to the topic of requirements.  What does the code need to do?  Is there a performance requirement?  A memory footprint requirement?  An efficiency requirement?  My usual advice is to create the simplest thing that works.  This allows you (and others) to more easily understand the code and to avoid wasting your time on "optimizing" things that don't need to be optimal.

Use object-oriented programming

In this case, there's a thing called a "progress bar" that is expected to indicate the progress of some user-controlled process.  This suggests that it might be better to create a ProgressBar object.  That way, the current state of the bar, including the particular characters used, and its representation could be separate aspects of the same object. This would be much cleaner and also have the advantage of making it easier to create alternative output formats.

Consider the user(s)

Consider the user of this progress bar (presumably another programmer, or perhaps yourself).  You might want to have some actual lengthy work done by the computer, and the progress bar is just an indicator.  However, with the loop and usleep in the printProgressBar function, it's entirely possible that the progress bar itself would take up more time than the lengthy process that led the user to want a progress bar in the first place!  There are a couple of ways to address this.  The simplest would be to abandon the current look of the progress bar with its animation-like bar and adopt a simpler proportional bar.  Another option would be to keep the existing visual effect, but to allow the percentage complete to be indicated by both how many stars are to the right, but also where the advancing star is within the empty space.  

That leads to the next consideration, which is the other user of this code, which is not the programmer, but a person using the program that includes this progress bar.  For that person, how clear is the intent of this progress bar?

Eliminate unused variables

This code declares main with arguments argc and argv in the usual way, but neither argc nor argv are actually used.  This could be addressed by either declaring int main() or by modifying the code to actually use the variables.