15,550 Topics

Member Avatar for
Member Avatar for klackey19

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" …

Member Avatar for klackey19
2
307
Member Avatar for TheBeast32

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 …

Member Avatar for developer_borja
0
655
Member Avatar for SSc

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

Member Avatar for donaldw
0
82
Member Avatar for Iam3R

[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 …

Member Avatar for kvprajapati
0
81
Member Avatar for klackey19

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!

Member Avatar for Narue
0
138
Member Avatar for neithan

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 …

Member Avatar for Narue
0
115
Member Avatar for Soileau

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 …

Member Avatar for dan63043
0
124
Member Avatar for Gaurav arora

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: * * …

Member Avatar for ashutosh1234
0
93
Member Avatar for SimonLeefe

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 …

Member Avatar for SimonLeefe
0
195
Member Avatar for Mattpd

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.

Member Avatar for Ancient Dragon
0
96
Member Avatar for cmk2901

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 …

Member Avatar for Ancient Dragon
1
166
Member Avatar for hjazz

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 …

Member Avatar for Ancient Dragon
0
232
Member Avatar for frank_hugo_1100

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 …

Member Avatar for mbit.dbms
0
274
Member Avatar for nhamyl

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 …

Member Avatar for jonsca
0
137
Member Avatar for shahab.burki

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 …

Member Avatar for gerard4143
0
242
Member Avatar for markeen

[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]; } …

Member Avatar for Ancient Dragon
1
117
Member Avatar for neithan

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 …

Member Avatar for neithan
0
96
Member Avatar for ROTC89

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] …

Member Avatar for ROTC89
0
129
Member Avatar for cmsc

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"); …

Member Avatar for cmsc
1
88
Member Avatar for Cmad

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.

0
61
Member Avatar for dieom

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; // …

Member Avatar for Ancient Dragon
0
88
Member Avatar for dewdropz

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) { …

Member Avatar for Ancient Dragon
0
206
Member Avatar for MeBjess

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? …

Member Avatar for MeBjess
1
88
Member Avatar for rahul.nutron

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]

Member Avatar for Ancient Dragon
0
51
Member Avatar for Iam3R

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 …

Member Avatar for Iam3R
0
87
Member Avatar for Mattpd

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 …

Member Avatar for kvprajapati
0
111
Member Avatar for thebluestar

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 …

Member Avatar for death_oclock
0
106
Member Avatar for cokacola

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 …

Member Avatar for death_oclock
0
118
Member Avatar for Mattpd

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 …

0
65
Member Avatar for Tamaki

At least for me it is:) This is an assignment problem and I can really use some help! [B][U]INTRO TO PROBLEM:[/U][/B] So the problem is a basic logic problem, where I'm sure you're all familiar with... From my assignment page, the problem [CODE]Imagine that you have 2 jugs, a small …

Member Avatar for Tamaki
-1
75

The End.