15,551 Topics
| |
Hi, I'm a beginner in C..please help. I'd like to get data from a textfile then store in a linked list and sort them by alphabetical order with the name and numeric with the number.My file like this: **file.txt** 16 Turin 13 Dingdong 14 Venise 12 Mud-Ca tha 02 Florence … | |
I'm new to C and I i have an assignment where I have to build a dictionary (Linked List in a way). Basically the user inputs several words,year and their definition this: Example: love_#_2004_#_LOVING trade_#_2001_#_INVEST etc... And basically i need a function to scan the definition (Ex: INVEST) and gives … | |
plese anyone can tell me about storage classes and their use in progg. >>>>>> | |
Hi there everyone, I'm a bit new to see and I need your help please. I'm stuck with a merge sort problem where it's support to sort my nodes in lexicographical order. Can you please have a look on my code because i've posted everywhere and i'm not getting the … | |
Hi there, I made a linked list program to add, delete, add in the middle and delete from anywhere. I'm searching to make a function to sort the string data that I have in lexicographic order. Here's my struct: struct node { char data[100]; struct node *previous; // Points to … | |
Hello guys, i'm having this project where i must create a server that communicates with a browser.I must write something like this in the browser: http://localhost:11880/path and the message printed in the server will be: GET /path HTTP/1.1 Host: localhost:11880 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101027 Ubuntu/10.04 … | |
while(1){ new=accept(socket, (struct sockaddr*)&peer_addr,&peer_addrlen); if (new<0){ break; } else{ recv(new,mesg,sizeof(mesg),0); if (strstr(mesg, "GET") != NULL){ printf("\n%s",mesg); FILE *write = fdopen(new, "w"); fprintf(write, "HTTP/1.1 200 OK\nContent-length: 47\nContent-Type: text/html\n\n<html><body>< H1>HTTP/1.1 200 OK</H1></body></html>"); fflush(write); } else if (strstr(mesg, "POST") != NULL){ strcpy(resp,"POST\nContent-length: 47\nContent-Type: text/html\n\n<html><body><H1>POST</H1></body></html>"); c=send(new,&resp,sizeof(resp),0); printf("%c",c); } else{ strcpy(resp,"HTTP/1.1 500 Server Interval Error\nContent-length: … | |
#include <stdio.h> static int Var1; static FUNC() { //do stuff with var } void CALL_FUNC() { //call FUNC //do stuff } void fc1(void) { CALL_FUNC(); } void fc2(void) { CALL_FUNC(); } void fc3(void) { CALL_FUNC(); } //etc. void main() { } goal is to break the fc1, fc2 and others … | |
I need some pointers with pointers. What is the difference between a variable preceded by an "*" and an "&"? Some of my sample code uses one and some the other. I'm getting compiler errors trying both saying the variable is not defined. First use this function. | |
I have a problem with registering a new employee for my project. It can only detect the first employeeID as an existing.. Here's my code: void registerNewEmployee(){ FILE *fp; struct employee obj; fp=fopen("data.txt","a+"); system("cls"); printf("\n\t*******************************************"); printf("\n\t*******************************************"); printf("\n\t***\t\t\t\t\t***"); printf("\n\t***\tNEW EMPLOYEE REGISTRATION\t***"); printf("\n\t***\t\t\t\t\t***"); printf("\n\t*******************************************"); printf("\n\t*******************************************\n\n"); char employeeIDNew[5]; printf("Employee Number: "); scanf("%s", &employeeIDNew); … | |
i need a code to add and subtract binary numbers. | |
This is an example of a singly linked list allowing you to enter a number of names and associated ages. The twist is that the names are inserted into the list in ascending order. When the list is displayed, it is already sorted by name. Note: This is not an … | |
I have attached data.txt file with contains all of the employees data. The problem is when I login, it would only read one record. Here's my code: #include <stdio.h> #include <conio.h> #include <string.h> #include <stdlib.h> int login(); void displayWelcome(); main(){ int result; do{ system("cls"); result = login(); if(result==1 || result==2){ … | |
What does -> mean in the following line of code? bulk_in=end_point->bEndpointAddress; My books show - and > but neither of them seem to apply. The books don't seem to show both together. This is part of a USB driver that I'm trying to convert from Linux to C for the … | |
Problem: input:square matrix of order n and a query which will denote the submatrix.(x1,y1,x2,y2) output:no of distinct elements in this submatrix. constraint:time limit=1 sec this is what i tried #include<stdio.h> //#include<conio.h> int main() { //clrscr(); int a[300][300],test[100000],count[10],m,n,c,j,p,q,r,s; long qu,re,i; scanf("%d",&n); for(i=0;i<n;i++) for(j=0;j<n;j++) scanf("%d",&a[i][j]); scanf("%ld",&qu); for(re=0;re<qu;re++) { c=0; for(i=0;i<10;i++) count[i]=0; scanf("%d … | |
#include <stdio.h> #include <conio.h> main() { int i,j,k,l,m,n; printf("Put in n nober of sqeur: "); scanf("%d",&n); printf("Whit wich nomber do you wanna start your squer?: "); scanf("%d",&m); for(j=m;j<=n+1;j++) { for(k=j;k<=n;k++) { printf(" %d",k); } for(l=1;l<j;l++) { printf(" %d",l); } printf("n"); } getch(); } Editor's note: moved to the appropriate forum | |
Hi friends, I want to implement code which can take input from some other application. Like say for example ls | less Here, less is the application/utility which takes input from ls via pipe. I want to implement the same in C. I Did following things 1. Created PIPES using … | |
WAP to print the sum of all the PRIME or EVEN integers in the array and ignore the remaining. | |
Which compiler must I use to create ?: 1. Bare metal utilities. 2. My Operating System. | |
this is a small graphical program in c....which gives you a clear discription about what a graphics can do in c..(a simple one) | |
hey guys ! so im learning c, got a question: so say i have a struct of students and inside the struct is name , id , fatherName, motherName. like this struct stds { int id; char name[21]; char fatherName[21]; char motherName[21]; } std[100]; suppose they are 100 stds and … | |
I need help with transposing a matrix. I already did the transpose matrix using 2 arrays. But I can't figure out how to do it using only one array. So read a matrix and create the transpose within itself. Do I use the swap or what? Any help would be … | |
So, I have attached my code below. It worked fine , until I introduced the part to print out what's in the input file. After I did this, it says it's completed, but I doesn't copy the content in the output file. What should I change? Thanks a lot /*Program … | |
I'm getting compiler errors in all my function prototypes. The error is "error: expected '=', ',', ';', 'asm' or '__attribute__' before 'CALCOR". CALCOR is the name of the function and the prototype is just the first line of the function followed by a semicolon as Ancient Dragon said in another … | |
I'm already having problems understanding structs even with two books. Now I get one with "struct struct". What does that mean. This is actually part of a linux program I'm trying to convert to C for PIC processors. Also I'm getting errors in this code that should work like "unable … | |
Bonjour tout le monde , Voila ma question : je prépare un TP en c qui consiste a crée un fichier input contient la taille en premier ligne et 2 matrice d'entier dans les autres lignes ex : 4 Matrice1 1235 5456 5428 2415 matrice2 8795 2514 6524 8562 le … | |
hello, i am trying to store a text from file into array to do some editing on it i did this void readFile(){ FILE *fp; long lSize; char *buffer; fp = fopen ( "s.txt" , "rb" ); if( !fp ) perror("s.txt"),exit(1); fseek( fp , 0L , SEEK_END); lSize = ftell( … | |
#include<stdio.h> #include<conio.h> void main() { printf("enter number:"); scanf("%d",&n); for(i=1;i<=y;i++) { x++; } t=x; for(i=1;i<=y;i++) { t--; } y=t; getch(); } |
The End.