Building a phonebook program for school--very much a work in progress. I still need to write a sort function, tweak my delete function, etc. But actually what I'm hoping you folks could answer is hopefully simpler--for some reason I seem to have a while loop that is executing twice, and I can't figure out why. When you try to do any function, like after adding a user...the menu prints twice. Any ideas what's going on? See code (line 24 is where the while loops starts that I think is the problem): [CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct PhoneBookContacts …
|+0 forum 8|
So from what I've been taught, in school and in books, all C programs(I assume C++ too) always have main(). That's very explicitly mentioned. However in my poking around with some relatively large open source projects in hopes of learning something, it isn't as straight forward. What I've encountered was that there were a lot of C files that only contained function definitions, as if being used as header files(which was confusing too since they weren't called via include. How they kind of go together escapes me). I found it weird because it seems that they were all connected, really …
|+0 forum 11|
I am making a video recording program that takes input from a v4l2 webcam and outputs to an avi file. Using gstreamer in c, I have got most of the program to work, and the file is created. I can get the pipeline to display the video to the screen, but I can't get the video file to record anything. It compiles, but I get some run-time errors that allow the program to keep running. If anyone could help, that would be great. The program is compiled by the following (on a Linux box): gcc -Wall $(pkg-config --cflags --libs gstreamer-0.10) …
|+0 forum 0|
I am a newbie to network programming. I been trying my luck with winsock and am stuck with no idea what to do. Here is a snippet of my code: [CODE]//Bind it to a TCP/IP port SOCKADDR_IN SockAddr; SockAddr.sin_port=24; /*Port to be used*/ SockAddr.sin_family=AF_INET; /*Connection Type: TCP/IP*/ /*Listen on IP address: 127.0.0.1*/ SockAddr.sin_addr.S_un.S_un_b.s_b1 = 127; SockAddr.sin_addr.S_un.S_un_b.s_b2 = 0; SockAddr.sin_addr.S_un.S_un_b.s_b3 = 0; SockAddr.sin_addr.S_un.S_un_b.s_b1 = 1; if(bind(socketDefinition,(SOCKADDR*)(&SockAddr),sizeof(SockAddr))==SOCKET_ERROR) printf("Attempt to bind failed.");[/CODE] The code is compiling properly but output is: "Attempt to bind failed." Any suggestions? Thanks.
|+0 forum 3|