You don't have to worry about redirecting stdout back to your terminal after netstat runs because execl does not return to your program (unless the command cannot be executed). I noticed that you're redirecting stdout to string.txt in the execl call anyway, which ignores your previous redirection. Why don't you use the system() function? It returns back to your program after the command exits.
Then again, do you really need to convert your shell script to C in the first place? Unless you need to do something that you can't do in a script very easily (like a GUI), I'd leave it as a script. Performance isn't an issue because most processing time is spent in the subprograms, not the script itself.
Or...could you call your script from C (with system())? That's another option.
Edit: I forgot to mention the popen()/pclose() functions. These let you run a program and read from its output (or write to its input) as if it were a regular file without using a temporary file. These are POSIX standard functions. You would have to use about 3 pages of Win32 API code to do the same thing in the Windows world.