Capture result from a function in C (cmd1 | cmd2)
Let us say that cmd1 print something on stdout. How can I capture it with cmd1 in C such that cmd1 | cmd2 works.

i.e

    cmd1{
        fprintf(stdout, "Hello");
        }
    
    cmd2 : should take "hello" and only print "hel".
Capture result from a function in C (cmd1 | cmd2)
===

Let us say that cmd1 print something on stdout. How can I capture it with cmd1 in C such that cmd1 | cmd2 works.

i.e

    cmd1{
        fprintf(stdout, "Hello");
        }
    
    cmd2 : should take "hello" and only print "hel".