i am trying to open a file in append mode using open() api call , however following code is not working ! Its not writing anything to file! here is my code :

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
O_APPENDis not a mode by itself; it’s a flag. Since the value ofO_RDONLYis 0, it’s like you’re trying to open the file read-only but for append, which is nonsense. UseO_WRONLY|O_APPENDorO_RDWR|O_APPEND.