TITLE: Exact sequence of sheaves in Beauville's "Complex Algebraic Surfaces"
QUESTION [9 upvotes]: On the first pages of Beauville's "Complex Algebraic Surfaces", he has a surface $S$ (smooth, projective) and two curves $C$ and $C'$ in $S$. He defines $\mathcal{O}_S(C)$ as the invertible sheaf associated to $C$. I'm assuming that if $C$ is given as a Cartier divisor by $(U_\alpha,f_\alpha)$, then $\mathcal{O}_S(C)(U_\alpha)$ is generated by $1/f_\alpha$ (following Hartshorne's notation); this assumption is justified as Beauville says that $\mathcal{O}_S(-C)$ is simply the ideal sheaf that defines $C$. 
The part I don't understand is that he then takes a non-zero section $s\in H^0(\mathcal{O}_S(C))$ (and the same for $s'$) and says that it vanishes on $C$. Isn't this the definition of a global section of $\mathcal{O}_S(-C)$ though (according to the previous notation)? 
He then writes the exact sequence (which I don't really understand)
$$0\to\mathcal{O}_S(-C-C')\stackrel{(s',-s)}{\to}\mathcal{O}_S(-C)\oplus\mathcal{O}_S(-C')\stackrel{(s,s')}{\to}\mathcal{O}_S\to\mathcal{O}_{C\cap C'}\to 0.$$
I need to have the definitions clear in order to be able to understand the exact sequence. Can anybody help me out?

REPLY [5 votes]: Beauville is right.     
a) The only global section of   $\mathcal{O}_S(-C)$ is zero: indeed $\mathcal{O}_S(-C)=\mathcal I_C\subset \mathcal{O}_S$ is the sheaf of holomorphic functions on $S$ vanishing on $C$.
 In particular since global holomorphic functions on the projective surface $S$ are constant, the only such function vanishing on $C$ is zero: $ H^0(S,\mathcal O_S(-C))=0\subset  H^0(S,\mathcal{O}_S)=\mathbb C$   
b) The part about  a section of $\mathcal O_S(C)$ vanishing on $C$ is devilishly subtle and, alas, not sufficiently explained in books.
Pragmatically, the point is that sections $s_\alpha \in H^0(U_\alpha,\mathcal O_S(C))$ are meromorphic functions on $U_\alpha$ of the form $\frac{h_\alpha }{f_\alpha}$ with $h_\alpha\in \mathcal O_S(U_\alpha )$.
But the vanishing set of $s_\alpha$ is that of $h_\alpha $!
Also, it is not true that every section $s \in H^0(S,\mathcal O_S(C))$ vanishes on $C$.
What is true is that there is a canonical section $s_0 \in H^0(S,\mathcal O_S(C))$ vanishing exactly  on $C$.
And that section is...
the constant function $1$ , seen as a section  $1=s_0\in H^0(S,\mathcal O_S(C)$ !
Indeed on $U_\alpha $ write $1=\frac{f_\alpha }{f_\alpha }$ and acccording to the pragmatic recipe above, the zero locus of that section is that of $f_\alpha$, namely $C \cap U_\alpha$.