int file

file = open("./some.txt", O_RDONLY);

Above line file=open giving me compile error:
'O_RDONLY' undeclared (first use in this function)

What is the problem here?

I am running linux and gcc 4.1.

Recommended Answers

All 2 Replies

What is the problem here?

I am running linux and gcc 4.1.

You're compiler doesn't know what O_RDONLY is.
Did you include fcntl.h?

thank you, that helped.

Merry Christmas

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.