Click here to Skip to main content
15,665,486 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: c++ Pin
Richard MacCutchan7-Apr-23 21:57
mveRichard MacCutchan7-Apr-23 21:57 
QuestionSnooker Game programing using c Programing. Pin
Francis Lagar3-Apr-23 7:37
Francis Lagar3-Apr-23 7:37 
AnswerRe: Snooker Game programing using c Programing. Pin
Richard MacCutchan3-Apr-23 9:57
mveRichard MacCutchan3-Apr-23 9:57 
AnswerRe: Snooker Game programing using c Programing. Pin
Gerry Schmitz3-Apr-23 10:19
mveGerry Schmitz3-Apr-23 10:19 
AnswerRe: Snooker Game programing using c Programing. Pin
jschell4-Apr-23 6:24
jschell4-Apr-23 6:24 
GeneralRe: Snooker Game programing using c Programing. Pin
Daniel Pfeffer4-Apr-23 7:40
professionalDaniel Pfeffer4-Apr-23 7:40 
SuggestionMessage Closed Pin
29-Mar-23 15:32
Member 1496877129-Mar-23 15:32 
GeneralRe: Socket or file descriptor ? Pin
k505429-Mar-23 17:18
mvek505429-Mar-23 17:18 
It returns an int. That int is similar to what you would get from open(2), and can be used in many places any other file descriptor could be - e.g read(2), write(2), and, of course, close(2). I think that some fcntl(2) operations are also valid for socket fds. But you'll probably get a error if you try to use lseek(2) on a socket. If you prefer, its a file descriptor that describes a socket. Just like open("/dev/ttyS0", O_RDWR) returns a file descriptor that describes a serial port and open("data.txt", O_WRONY|O_CREAT, 0660) returns a file descriptor that describes (presumbably) a text file in the CWD, or open("/tmp/mypipe", O_RDONLY) returns a file descriptor that might be a named pipe.

NB: in the notation open(2) the (2) refers to the manual section that describes the system. So for example man 1 stat produces the man page for the stat command, whereas man 2 stat produces the man page for the stat system call.
Keep Calm and Carry On

GeneralRe: Socket or file descriptor ? Pin
Richard MacCutchan29-Mar-23 21:38
mveRichard MacCutchan29-Mar-23 21:38 
GeneralRe: Socket or file descriptor ? Pin
jschell30-Mar-23 5:45
jschell30-Mar-23 5:45 
GeneralMessage Closed Pin
30-Mar-23 6:28
Member 1496877130-Mar-23 6:28 
GeneralRe: Socket or file descriptor - more questions ? Pin
k505430-Mar-23 9:31
mvek505430-Mar-23 9:31 
QuestionFind X,Y index into 2D array/matrix using an angle and number of cells Pin
imk12326-Mar-23 7:37
imk12326-Mar-23 7:37 
AnswerRe: Find X,Y index into 2D array/matrix using an angle and number of cells Pin
Mircea Neacsu26-Mar-23 8:04
Mircea Neacsu26-Mar-23 8:04 
AnswerRe: Find X,Y index into 2D array/matrix using an angle and number of cells Pin
Gerry Schmitz26-Mar-23 8:50
mveGerry Schmitz26-Mar-23 8:50 
QuestionWhat is the difference in C and C++ in terms of memory management ? Pin
Gulshan Negi20-Mar-23 22:57
professionalGulshan Negi20-Mar-23 22:57 
GeneralRe: What is the difference in C and C++ in terms of memory management ? Pin
Richard MacCutchan21-Mar-23 2:11
mveRichard MacCutchan21-Mar-23 2:11 
AnswerRe: What is the difference in C and C++ in terms of memory management ? Pin
jschell21-Mar-23 5:41
jschell21-Mar-23 5:41 
QuestionC language Pin
Pavani M18-Mar-23 5:24
Pavani M18-Mar-23 5:24 
AnswerRe: C language Pin
Richard MacCutchan18-Mar-23 6:53
mveRichard MacCutchan18-Mar-23 6:53 
AnswerRe: C language Pin
CPallini19-Mar-23 22:33
mveCPallini19-Mar-23 22:33 
QuestionMessage Closed Pin
5-Mar-23 5:33
Member 149687715-Mar-23 5:33 
AnswerRe: Reorganizing code Pin
Richard MacCutchan5-Mar-23 21:56
mveRichard MacCutchan5-Mar-23 21:56 
QuestionMessage Closed Pin
3-Mar-23 5:42
Member 149687713-Mar-23 5:42 
AnswerRe: How to implement variable amount of parameters? Pin
Mircea Neacsu3-Mar-23 6:10
Mircea Neacsu3-Mar-23 6:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.