15,551 Topics
| |
Where are the function bodies to functions like socket,bind,accept, etc??... Using the c socket network programming for unix based systems, we use the api, but where are the function bodies to these functions. Im doing network programming, and I fill in the socket functions, bind, accept, write, read, etc, but … | |
I am new to network programming, and trying to read a response from a servers webpage. I can connect, but cannot get the pages source. Heres what I have [CODE] #include <stdio.h> #include <sys/socket.h> #include <arpa/inet.h> #include <netdb.h> int main(int argc,char **args){ if(argc < 2){ printf("2 args\n"); return 1; } … | |
Hey guys I'm having a little problem with reading from a text file, here's how the text is formatted: [QUOTE]random string$52$44$5$abc random string$52$44$5$abc_def random string$52$44$5$abc_defgh[/QUOTE] this code is what I use to read the text [CODE]#include <stdio.h> #include <conio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> char name[100][100]; char position [100][100]; … | |
I'm writing a small app to do automated testing of a console application. It needs to repeatedly run the app with various options and handle when the app being tested crashes. I started with system(), moved on to spawn() and have since been trying CreateProcess(). It doesn't lockup when the … | |
I am working on an OpenGL project in C using Xcode 3.2.6. It is a tutorial program and yet I am having problems with it. When I double-click Project.app, it opens for a quarter of a second then closes. The source is: [CODE]#import <Cocoa/Cocoa.h> #include <GLUT/GLUT.h> int main(int argc, char … | |
I want convert c code into matlab how it is to be done? can I do this to get my best result.plz tell me in details. | |
Returns the largest sum of contiguous integers in the array Example: if the input is (-1, 2, -3, 2, 0, 5, -11), the largest sum is 7 Time complexity is O(n). | |
well i am trying to pass this parameter in a function -->[ICODE]char*[I]filename[/I][/ICODE] [CODE] [U][B]//i just wrote this as an example to explain clearer my question[/B][/U] #include<stdio.h> #include<stdlib.h> void try (char *[I]filename[/I]) //[B] the question is how can i use the pointer to refer to a file? [/B] { printf("try"); } … | |
Hello i need to write a program read a text file and store the data with text in the format of : name 14 6 name2 15 26 However i cannot use fopen() scanf() getline() or fgets(), it has to be done with only open() read() and strtok() i have … | |
1)w.a.p. in c language that accepts a file as input and prints the no. of words in it. 2)w.a.p. in c language that accepts a file as input and converts all alphabetic characters in it to upper case. 3)w.a.p. in c that accepts a string and prints the list of … | |
What is the error in this simple code: [CODE]#include <stdio.h> int main() { char a[100]; int c; int i = 0; int x = 0; while( ( c = getchar() ) != '\n' ) { a[x++] =c; } a[x] = '\0'; while( ( a[i] != '\0' ) || ( a[i] … | |
A simple program to calculate permutations of a string using recursion, I have used a malloc string of size 100 , you can change it to whatever value you want. The author is currently working at Microsoft,any questions can be directed to [email snipped] | |
hi this is a course work question and i have tried multiple methods to get it to work so if you can show me where i'm going wrong i would greatly appreciate it. i have to read a 4 character input and create each of the numbers into a sort … | |
i have downloaded pdcurses and installed it. and , right now i am studying a ncurses tutorial , [url]http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/intro.html[/url] there are some sample examples also. but, when i try to compile "form" code examples , i see that there are no <form.h> header file in the pdcurses installation. has, anyone … | |
Hi friends, I need to make a simple parser for parsing PHP files (classes, functions et al) and I have read both Flex and Bison manual. I have read somewhere that I must build Abstract Syntax Tree (AST) and utilize that. But I cannot find any tutorial on how to … | |
Dear all, how can i make a program that count the different words in a text(input stop with EOF) and the number of the lines which a word appears? | |
Hi, i am making a text editor with mouse programming.Given is my code .the compiler is not giving any error but i am unable to use enter,delete,backspace and arrow keys . can any one please tell me the logic with which i can make my project more better. THANKS in … | |
[CODE]#include<stdio.h> #include<conio.h> int main() { FILE *p,*p2; char c; long l; long x; p=fopen("file1.txt","w"); printf("enter the content of file:"); while(c=getchar()!=EOF) { putc(c,p); } fclose(p); p=fopen("file1.txt","r"); // l=fseek(p,1L,2); l=ftell(p); p2=fopen("file2.txt","r"); c=getc(p); while(l!=-1) { if(c==' ') { x=ftell(p); // fseek(p,-1L,1); while(c=getc(p)!=' ') { putc(c,p2); fseek(p,-2L,1); } // fseek(p,x+1,0); } fseek(p,x,0); l=ftell(p); c=getc(p); … | |
I have a menu: [code] #include <exec/types.h> #include <intuition/intuition.h> #include <libraries/gadtools.h> /* Prototypes for system functions. */ #include <proto/exec.h> #include <proto/intuition.h> #include <proto/gadtools.h> /* ANSI C includes. */ #include <stdio.h> struct IntuitionBase *IntuitionBase = NULL; struct Library *GadToolsBase = NULL; struct NewMenu window_menu[] = { { NM_TITLE, "Project", 0 , … | |
Hi guys i have a problem with my code :[CODE]#include<stdio.h> #include<string.h> #include <stdlib.h> #include <conio.h> struct blahblah { char id[11]; char name[30]; float gpa; }lol[100]; int main(){ int count = 0; char name [50][100] ; for(int i =0;i<=4;i++){ printf ("Student %d\n",i+1); printf ("ID: "); gets(lol[i].id); printf("Name: "); gets(lol[i].name); printf ("GPA … | |
Hi, do you know why my output does not working properly.. Actually my output should looping,but it straightly ending the program.. [CODE]#include<conio.h> #include<stdio.h> int main () { int choice = 0 ; while ((choice>=1)&&(choice<=5)) { printf ("\nPlease Choose No 1 , 2 , 3 , 4 , 5\n"); printf ("Enter … | |
Hello do you know why my output not looping ? Even I already use "do" to make this code for looping.. [CODE]#include <stdio.h> #include <conio.h> int main () { int hari; double duit; do { printf ("Mari rent kerete..."); printf ("\nkalau 1 hari = 100"); printf ("\nkalau 2-4 hari = … | |
im wrote a program to determine weather a triangle is scalene, isosceles or equilateral based on the given side lengths...its not working properly..i.e its giving isoceles when i enter data for an equilateral...etc etc... i fugured it was my logic in writing the program that was missing something....could anyone tell … | |
[CODE]int a[10][20][30][40]; int *p[/CODE] How to access an element of a using p? .... PLs provide the actual code for the solution | |
Hi, i want to make a program that lets the user input as many numbers as they like and terminates when the user enters "EXIT" and prints the largest & smallest input, heres my code: [CODE]#include<stdio.h> #include<string.h> #include <stdlib.h> int main (){ int input; int min,max,a=0; char exit[] = "EXIT"; … | |
Program 66: Tromino Tiling An N x N (where N is a power of two) chessboard can be tiled with L-shaped tiles that cover three squares so that any given square and only that square is left uncovered. Assume that the rows of the board are numbered from one to … | |
i have a project(sort of) where i have to write a c programto take in user inputs and store it into a mysql database for future retreival. now, i have written the program for console mode. ie it asks the user [quote]please enter a name [/quote] and then the name … | |
Can anyone pls explain the output for this [CODE=c] int main() { int i=10; printf("%d %d %d",i++,--i,i); return 0; [/CODE] according to me the o/p should be 9 9 10 however gcc compiler is giving o/p is 9 10 10 can anyone explain me this.... | |
Well, hello. I have a problem with reading data from binary files into arrays. For example, let's say that we have d.bin file which contains pairs of strings with max lenght of 32 chars and double values like this: string12.334343 AS34.34 something3 where the string always takes up 32 bytes. … | |
Who can calculate tax in C using Control Statement, Arrays, Functions and Pointers... if you are so good show me what you Got... |
The End.