¡@

Home 

c++ Programming Glossary: perror

Handling Partial return from recv() TCP in C

http://stackoverflow.com/questions/1386142/handling-partial-return-from-recv-tcp-in-c

looks like if numbytes recv sockfd buf MAXDATASIZE 1 0 1 perror recv exit 1 buf numbytes ' 0' printf client received ' s' n..

substitute for fork()ing? in windows

http://stackoverflow.com/questions/4243880/substitute-for-forking-in-windows

need the listener if send new_fd Hello world 13 0 1 perror send close new_fd exit 0 I'm on a windows machine and cant.. yes sizeof int 1 cout Couldnt clear blocked port. endl perror setsockopt exit 1 if bind sockfd loop_find ai_addr loop_find.. ai_addr loop_find ai_addrlen 1 closesocket sockfd perror server bind continue break if listen sockfd BACKLOG 1 cout..

How to get a list of video capture devices (web cameras) on linux ( ubuntu )? (C/C++)

http://stackoverflow.com/questions/4290834/how-to-get-a-list-of-video-capture-devices-web-cameras-on-linux-ubuntu-c

video_picture video_pic if fd open dev video0 O_RDONLY 1 perror cam_info Can't open device return 1 if ioctl fd VIDIOCGCAP video_cap.. open device return 1 if ioctl fd VIDIOCGCAP video_cap 1 perror cam_info Can't get capabilities else printf Name t t ' s' n.. video_cap.maxheight if ioctl fd VIDIOCGWIN video_win 1 perror cam_info Can't get window information else printf Current size..

C++ SMTP Example

http://stackoverflow.com/questions/58210/c-smtp-example

Create Socket sock socket AF_INET SOCK_STREAM 0 if sock 1 perror opening stream socket exit 1 else cout socket created n Verify.. if connect sock struct sockaddr server sizeof server 1 perror connecting stream socket exit 1 else cout Connected n Write..

How can I get a list of files in a directory using C or C++?

http://stackoverflow.com/questions/612097/how-can-i-get-a-list-of-files-in-a-directory-using-c-or-c

s n ent d_name closedir dir else could not open directory perror return EXIT_FAILURE It is just a small header file and does..

Why is reading lines from stdin much slower in C++ than Python?

http://stackoverflow.com/questions/9371238/why-is-reading-lines-from-stdin-much-slower-in-c-than-python

input_line MAX_LINE stdin NULL line_count if ferror stdin perror Error reading stdin. Now here are the results using an even..

Linux 3.0: Executing child process with piped stdin/stdout

http://stackoverflow.com/questions/9405985/linux-3-0-executing-child-process-with-piped-stdin-stdout

2 int nChild char nChar int nResult if pipe aStdinPipe 0 perror allocating pipe for child input redirect return 1 if pipe aStdoutPipe.. 0 close aStdinPipe PIPE_READ close aStdinPipe PIPE_WRITE perror allocating pipe for child output redirect return 1 nChild fork.. redirect stdin if dup2 aStdinPipe PIPE_READ STDIN_FILENO 1 perror redirecting stdin return 1 redirect stdout if dup2 aStdoutPipe..

recursive folder scanning in c++

http://stackoverflow.com/questions/983376/recursive-folder-scanning-in-c

1 argv 1 dot FTS tree fts_open paths FTS_NOCHDIR 0 if tree perror fts_open return 1 FTSENT node while node fts_read tree if node.. change the program's current working directory if errno perror fts_read return 1 if fts_close tree perror fts_close return.. if errno perror fts_read return 1 if fts_close tree perror fts_close return 1 return 0 Again it's neither compile tested..