15,551 Topics
| |
So I have this project to program an "auto parts management" C program. Basically I need to be able to add and delete lines of text from a text file. Also, I need to be able to edit lines of text. Lines of text are in the format: PART NAME … | |
I am writing a program that sorts an array of either floats or doubles -- this is specified at compile time via a command to the compiler. I also must use void pointers. My program compiles, but when I try to run it with floats I get a "segmentation fault" … | |
Hi, I installed cygwin recently and wanted to do some network programming with it. Since I have never used unix sockets before, I'm reading Beej's Guide To Network Programming. I took this from section 5.1 and tried to compile it. I get a few errors that I can't figure out … | |
Hi! I'm new to programming and have difficulties in working out the following two examples: [IMG]http://www.pictureupload.de/originals/pictures/241109145734_Unbenannt.JPG[/IMG] hope someone can help me | |
[CODE] enum fivenums {Z,O,T,TH,F,FI} int main() { char ch; int num; do{ scanf("%d",&num); switch(num) { case Z: printf("ZERO\n"); break; case O: printf("ONE\n"); break; case T: printf("TWO\n"); break; case TH: printf("THREE\n"); break; case F: printf("FOUR\n"); break; case FI: printf("FIVE\n"); break; default : printf("Invalid\n"); break; } getchar();// to eat '\n' terminator so … | |
Hey everyone, I'm coding a program in C and have a pointer called pRoot. I need to do (2 * pRoot) .. but the compiler says I cannot. Is there some legal way of implementing this pointer arithmetic? Thanks in advance for your help! | |
Hi, i'm just mixing file handling and struct types and pointers to learn, but i'm a little stuck on this. I might be doing something awfull i can tell, sorry for that. Can anyone help? What's the best way to pass [CODE]#include <stdio.h> #include <ctype.h> #include <string.h> #include <stdlib.h> struct … | |
I am trying to write a function to add two arrays. The catch is that the arrays have to parts of a structure. So here is what I have so far: [CODE]#include <stdio.h> struct poly { array1[]; array2[]; length; }; void polyadd(int array1[],int array2[],int length) { int i; struct poly … | |
hi! i m Gaurav. i m facing a problem in printing a series i have print the series related to it. like * * * * * * * * * * * * * * * but i m facing a problem in printing the following series: * * … | |
I have an arbitrary number of files whose names I will know and I want to open them for reading. The important point is that I do not want to open them sequentially using a single file pointer. I need to have them all open at the same time. This … | |
I have written some bash shell scripts, using grep and sed. Are there any functions in C that do something similar to grep and mainly sed? I need to be able to edit and delete individual lines of text in an external txt file, based on user input. | |
Hi, I have a char* buffer that is 1024 bytes in size, and am trying to write an int to a particular offset in the buffer, in this case 0, but all offsets have the same problem. I initialize the buffer to some values when I first start up. For … | |
Hi all, I'm new to using Visual Studio. I'm currently using VS .NET 2003 on Vista, and I'm trying to port a program from Linux to Windows. The program uses the pcap library. I have installed WinPcap 4.0.2 and downloaded the Developer's Pack WpdPack_4_0_2. However, I have no idea what … | |
can any one put me on the start of using serial port? i need to know the pins and protocols to use serial port, i know alittle information and how we configure it by using c programming language and visual c++.if there is asite to learn me using serial port … | |
this program has information about customers. this program has to perform the following functions. - display list of all customers - search by name - search by id - display list of customers having credit limit above 5000 - add new customers i am unable to compile the program. here … | |
Hi, I am trying to develop a small IPv6 application in C. I am stuck at server side. GCC issues the error while call to ACCEPT function "socket function on non-socket". Can anyone help me? 1. Client Code [CODE]#include "shahab.h" int main(int argc, char **argv){ int connectSocket; int numberOfBytes; char … | |
[code] #include<stdio.h> #include<conio.h> int main() { int x[5], y[5], z[5], i, d; for(i=0;i<5;i++) { printf("Enter int%d: ", i); scanf("%d", &x[i]); } if((x[0]>x[1]) && (x[0]>x[2]) && (x[0]>x[3]) && (x[0]>x[4])) { y[0]=x[0]; if((x[1]>x[2]) &&( x[1]>x[3]) &&(x[1]>x[4])) { y[1]=x[1]; if((x[2]>x[3])&&(x[2]>x[4])) { y[2]=x[2]; if((x[3]>x[4])) { y[3]=x[3]; y[4]=x[4]; } else if((x[4]>x[3])) { y[3]=x[4]; y[4]=x[3]; } … | |
Hi everyone, i have this portion of code [CODE=c]while(c = getc(file) != EOF)[/CODE] c is an int and file is a FILE *file = fopen(filename, "r"); The filename points to a file with 2 lines, 10 characters total. That while always makes c a value of 1 (accodring to ASCII … | |
ok so i am having problems with my program. its a client program talking to the server program. i have both programs working fine but i do not know how to get the conversation to display on the server side of the conversation. here are the codes and makefile [code=c] … | |
I want to make a dynamic array. but when I view the array, I think there's something wrong with the index part. Please help. Thanks! here's my code: [CODE] #include<stdio.h> main(){ int* a; int number; int choice; int index = 0; int head; while(choice!=4){ printf("\tMENU\t\n"); printf("[1] add number to array\n"); … | |
Iam currently working on the design of preemptive scheduler iln Borland C. I want to know about the use of interrupts and timers in Borland C for preempting the task. Just clue of upgrading about them is enough. | |
What I am trying to accomplish here is to split a long integer apart so I can look at its first, last, and center digits. What I am currently using is this: [code]int main() { long i, t[1024]; i = 100; while (i < 150) { t = i; // … | |
hi, i am new to c have to write a program to check the shape. I think the error is somewhere at shape= square. I know i can use printf statements but i want it in this format. Can someone help me please? [code] #include <stdio.h> int main (void) { … | |
I have been working on a basic accounting program, the accounts were supposed to be stored in a array, but I never got that part of the program working. Is there anyway I can get a sample of hash code that would help me understand what I need to do? … | |
I have to create a matrix in c from microarray data that so I have to read each string line wise and compare they are related or not. help me....[b]***[/b] | |
Hi , this one is with respect to C. (i) when we use array an array index always starts from zero . is it a standard one? or compilers are implemented that way? if compilers are implented that way they must have followed some standard. (ii) the array name cannot … | |
If I run the program, and select q, it will quit correctly. If I select e it goes to the edit menu [B]but prints it twice[/B]. If I then select q it goes to the main menu [B]and prints the default case, "please select from menu", then prints the main … | |
Here is the problem:write in saparate function without using global variable 1/(function input)enter N in the range [0,20], then enter N numbers 2/(function display)Display N numbers in 2 columns Here is my source code [CODE=C] #include<stdio.h> #include<conio.h> void Input(int *p,int n) { int i; do { printf("Enter N numbers u … | |
The purpose of the program is to take a position and count how many "pixels" are in the "blob". If there is no "pixel" aka the value is 0, the blob number is 0. If there is a pixel, the blob_check function recursively checks the surrounding cells for "pixels" aka … | |
In the title I was going to write (not C script) but they are essentially the same I think. My bad, anyway... I recently wrote a some SH scripts to manage lines of text in a separate txt file. Now my new assignment is to convert the whole thing to … |
The End.