Home
Assignments
Place Order
How It Works
About Us
Contact Us
Sign In / Sign Up
Sign In
Sign Up
Place a Quick Order
Email Address
Subject / Courses Code
Length
Pages
-
+
Slides
-
+
Deadline
Days
0 Days
1 Day
2 Days
3 Days
4 Days
5 Days
6 Days
7 Days
8 Days
9 Days
10 Days
11 Days
12 Days
13 Days
14 Days
15 Days
16 Days
17 Days
18 Days
19 Days
20 Days
21 Days
22 Days
23 Days
24 Days
25 Days
26 Days
27 Days
28 Days
29 Days
0
Hours
0 Hours
1 Hours
2 Hours
3 Hours
4 Hours
5 Hours
6 Hours
7 Hours
8 Hours
9 Hours
10 Hours
11 Hours
12 Hours
13 Hours
14 Hours
15 Hours
16 Hours
17 Hours
18 Hours
19 Hours
20 Hours
21 Hours
22 Hours
23 Hours
1
Level
High School
Diploma
Undergraduate/College
Post Graduate/University
PhD/Doctorate
Reference Style
ACS
AGLC
APA
APSA
BMJ
Chicago
Footnotes
Footnotes and bibliography
Harvard
IEEE
MHRA
MLA
Not Selected
Open
OSCOLA
Oxford
Turabian
Vancouver
Any Style
None
Description
Use C to write a program that: The source process reads information from a file (Therefore, you need to prepare a small text file for testing purpose). The source process calls fork() to create the filter process. The filter process reads information from the source process (passed via an anonymous pipe), converts the uppercase characters to lowercase ones and vice versa, and then prints out the converted characters to the screen. How to create an anonymous pipe: pipe() API. **** I attempted the problem, and it is shown in the picture, but it outputs: Segmentation fault (core dumped). I dont know whats wrong**** Show transcribed image text #include #include #include #include #include #include #include #include int main (void) char str[1000]; //buffer int ap[2]; //file descriptor FILE *fp; fpopen("text.txt", "r)I/open file int x read (fp, str, 1000); fclose(fp); //close file pid t pipe; I/fork if ((pipe-fork))) /Ichild close (ap[1]) //close writing on first pipe char str[1000]: read (ap[0], str, 1000); I/read string on first pipe intx strlen (str); //convert upper to lower and vice versa for (int í = 0; i
Attachments
Upload
Order Amount:
$
10