# How to save coordinates from paths

I want to draw a sequence of connected line segments using separate paths, so I can add arrow tips and tails to them.

In the MWE below, how can I draw a path from the end of (O) -- (A) -- ++(B) to the end of (O) -- (A) -- ++(B) -- ++(C)? That is, how can I save the end coordinate of (O) -- (A) -- ++(B) as a coordinate for a new path?

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\coordinate (O) at (0,0);
\coordinate (A) at (50:1);
\coordinate (B) at (160:1);
\coordinate (C) at (220:1);
\draw[|->] (O) -- (A);
% how to start a new path from the final point on this path?
\draw[|->] (A) -- ++(B);
\end{tikzpicture}
\end{document}


You can simply add e.g. coordinate (D) at the end of the path to name a coordinate at that spot.

\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\coordinate (O) at (0,0);
\coordinate (A) at (50:1);
\coordinate (B) at (160:1);
\coordinate (C) at (220:1);
\draw[|->] (O) -- (A);
% how to start a new path from the final point on this path?
\draw[|->] (A) -- ++(B) coordinate (D);
\draw [|->] (D) -- ++(C);
\end{tikzpicture}
\end{document}


Alternatively, you could use an edge, which produces the same output.

\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\coordinate (O) at (0,0);
\coordinate (A) at (50:1);
\coordinate (B) at (160:1);
\coordinate (C) at (220:1);
\draw[|->] (O) -- (A);
% how to start a new path from the final point on this path?
\draw[|->] (A) -- ++(B) edge ++(C);
\end{tikzpicture}
\end{document}