I am starting read a book about Computational Complexity and Turing Machines. Here is quote:


  An algorithm (i.e., a machine) can be represented as a bit string once
  we decide on some canonical encoding.


This assertion is provided as a simple fact, but I can't understand it. 

For example, if I have an algorithm which takes $x$ as input and computes $(x+1)^2$ or:

int function (int x){
   x = x + 1; 
   return x**2; 
}


How that can this be represented as string using alphabet $\{0, 1\}^*$?

The most naive and simple answer to your question is that the code provided (and compiled machine code) are in-fact represented as syntactic strings of {0,1}*. Additionally, since you are talking about turing machines, the programs they run are a linear list of operations/instructions, there is no reason these cannot be represented as bits/bytes. 