15,551 Topics

Member Avatar for
Member Avatar for honberiz

I've written the code to determine if a year is a leap year or not, reading from a file, and printing to a file, and telling how many years were checked. I'm having trouble figuring out how to convert it to utilizing functions in the program, for the actual calculations …

Member Avatar for Adak
0
158
Member Avatar for rashmideesh

hi.. i'm writing a program where a file contains a set of phonenumbers. when a customer buys a number that particular number has to be deleted from the file. i'm able to delete that number but when the next customer comes that number is still available. even though the number …

Member Avatar for Adak
0
171
Member Avatar for myk45

Hello, i have a small doubt regarding the FILE structure. i looked it up in the header file (i have VC++ 2008). In this implementation, it was declared as: [CODE]struct _iobuf { char *_ptr; int _cnt; char *_base; int _flag; int _file; int _charbuf; int _bufsiz; char *_tmpfname; }; typedef …

Member Avatar for myk45
0
212
Member Avatar for da_navigata24

Hi, I'm fighting a battle with a linked list and I am currently losing. I am using the toolkit, pointers, nodes and a class. My code is still buggy because after building it, it just runs for a while then stops. Please help. Here is what I have, an implementation …

Member Avatar for Eagles36
0
271
Member Avatar for chris5126

Hi, I have a machine with X-Fi Titanium sound card. Im getting the following errors when trying to compile the driver. [CODE] make make -C /lib/modules/2.6.9-89.0.23.ELsmp/build M=/root/XFiDrv_Linux_Public_US_1.00 make[1]: Entering directory `/usr/src/kernels/2.6.9-89.0.23.EL-smp- x86_64' CC [M] /root/XFiDrv_Linux_Public_US_1.00/xfi.o In file included from /root/XFiDrv_Linux_Public_US_1.00/xfi.c:17: /root/XFiDrv_Linux_Public_US_1.00/ctatc.h:22:34: linux/spinlock_types.h: No such file or directory make[2]: *** [/root/XFiDrv_Linux_Public_US_1.00/xfi.o] …

Member Avatar for chris5126
0
488
Member Avatar for Perry31

Hi friends, I've created program for getting the data members from the structure and pass those variable in a function dynamically. The structure will dynamically change and its members also changing.Now i need to rectify the memory leak problem in this.I declared maximum size of buffer is 30000 when i …

Member Avatar for Perry31
0
150
Member Avatar for stud02

I have a working c file which count lines from a text file. Is there a function that filters out lines with comments(lines started with //)? So when I load in a text file with a c code, it only has to count the lines without comment.

Member Avatar for WaltP
0
133
Member Avatar for brendono978

Hey everybody, here's my assignment. "Program 69: String Pattern Matching – Naïve Approach Write a program that will prompt the user to enter a string of characters. There will be a maximum of 10 characters entered for the string. The program will then ask the user to enter lines of …

Member Avatar for brendono978
0
1K
Member Avatar for DrueY

Error C2057: expected constant expression Error C2466: cannot allocate an array of constant size 0 Error C2133: 'inc': unknown size Why? Here's the code: [CODE] #include <stdio.h> #include <stdlib.h> #include <fftw3.h> static double *rdata = NULL, *idata = NULL; static fftw_plan rplan, iplan; static int last_fft_size = 0; double A[8192]; …

Member Avatar for DrueY
0
317
Member Avatar for karpe

Hi all Happy to join this forum, hope you can help me from time to time :) I'm and electrical engineer, and I use C program as part of my work, at a very basic level, just to control a piece of hardware. I now have a problem which I'm …

Member Avatar for karpe
0
186
Member Avatar for ItecKid

I have this code. pthread_create does not through an error message, however it does not execute it's argument function. See comments in code for better description [code=c] void * moveFiles (void * arg); int main (int argc, char **argv) { pthread_t * tid; int rc = 0; /*variables count and …

Member Avatar for ItecKid
0
2K
Member Avatar for ItecKid

Hello, I am trying to read through a UNIX directory in C and write all the filenames to an array. However, the array is not being populated with any value. Here is a snippet of relevant code: [code=c] char **files = {NULL}; struct stat fileinfo; int count = 0; int …

Member Avatar for nezachem
0
109
Member Avatar for mi.mac.rules

I'm making a program to add/sub/mult numbers from bin/oct/dec/hex format and output in whatever base the user asks, run syntax: [CODE]./instruction <num1> <num2> <base1> <base2> <output base>[/CODE] and, besides the stupid implicit declaration warnings I get for some unknown reason (I'd love to know why), when I run this (I'm …

Member Avatar for mi.mac.rules
0
241
Member Avatar for creeps

Yes, it's yet another thread about implementing three basic operations (addition, subtraction and multiplication) on abnormally large numbers (> 100 digits). I've stored each digit inside an array of [icode]int[/icode]s, as the following piece of code illustrates [code=C] while((ch = getchar()) != EOL) a[len_a++] = ch - CHR; [/code] Now, …

Member Avatar for Shift-Stop
0
256
Member Avatar for vanan4u

question.. You are required to write a complete C program for a simple grading system. At the beginning of the system, you need to input number of students and number of subjects that have been marked. Then, you need to enter the student's identification number and marks for each subject. …

Member Avatar for vanan4u
0
154
Member Avatar for wvuengr33

The program I am writing is supposed to read in a txt file and then align the txt depending on the number of characters per line that the user has specified. Since there aren't any limitations to the length of the text it has to be represented using a dynamic …

Member Avatar for wvuengr33
0
504
Member Avatar for bufospro

Hi, I am trying to read a string using the function below. The problem I have is that I can't write space in my string. So strings like : "name fullanme" are rejected and returns only "name". [CODE] char *getstring(char *ret, int max) { char *ppp, *qqq; int invalid_characters=0; //fgets(ret,max,stdin); …

Member Avatar for bufospro
0
185
Member Avatar for deepak.hm123

Somone please help me writing a code for "Reverse a word in a String" in c.. Ex: My name is XYZ o/p:XYZ is name My

Member Avatar for N1GHTS
0
214
Member Avatar for samp4ever

Hi everybody, I'm doing a simple client server communication system. The client have to send in a TCP socket a couple of strings and the server receive them, then have to search in a buffer if a category is similar to even just one of the strings sent by the …

Member Avatar for samp4ever
0
700
Member Avatar for CleanSanchez

My assignment is to make a program that can perform a card trick. You may be familiar with the concept of the trick, but here is a [URL="http://www.youtube.com/watch?v=0LrUy8W5RnQ"]video link[/URL] from my instructor. It is a fairly long program, but everything works as planned EXCEPT for my "PickUp" function, which is …

Member Avatar for CleanSanchez
0
150
Member Avatar for rocky2008

can anyone please tell me the function of calloc() and malloc() and the difference between them ... what does (char*)malloc(n) mean ??

Member Avatar for surendra verma
0
177
Member Avatar for Unidennn

Im trying to figure the way and i just cant, any help would be appriciated. [CODE] void main () void abc (int ss[][7]); { int ss [6][7]=blah blah blah blah.... abc (ss); } void abc (int ss[][7]) { for (i=blah.... for (j= blah ss[i][j]=blah... blah blah } [/CODE] error: declaration …

Member Avatar for vijaykrishnabor
0
81
Member Avatar for rollercoaster

hi Iam having trouble arranging 3 words in alphabetical order lowest to highest inputted from the keyboard.Help would be appreciated.

Member Avatar for vijaykrishnabor
0
122
Member Avatar for penny90

this is the output instruction:0 11001100 101110 after extension:0 11111100 111111101110 result:111111011110 result in decimal=-34 opcode is the arithmetic operation:1 for addition and 0 for subtraction.operand 1 and operand 2 is any 12 bits two compliment integer in binary format. 1 bit | 12bits |12 bits opcode| operand1 |operand2 hope …

Member Avatar for WaltP
-1
147
Member Avatar for shante88

[B]question:[/B]Ten arrays of string of characters representing ten surnames are to be inputed from the keyboard. the strings are of diffrent length but none is longer than 20 characters. It is required to arrange these surnames aphabetically, and to determine the length of each surname.implement in c and print out …

Member Avatar for abhimanipal
0
107
Member Avatar for Rahul.menon

[CODE] #include<stdio.h> #include<conio.h> #include<math.h> int a[70]; //src disk array int b[70];//temp disk array int c[70];//tar disk array int val, srcval=1,tempval=0,tarval=0; int es[3] = {1,1,0}; //array to decide iteration of disks from and to int et[3] = {1,0,1}; int etr[3]= {0,1,1}; int os[3] = {1,1,0}; int ot[3] = {0,1,1}; int otr[3]= …

Member Avatar for Shift-Stop
0
228
Member Avatar for digitaldan

Hello All, I've spent a ton of time on this code and am all of a sudden having a strange occurrence. While executing the case1 in my switch, it blasts through without accepting the user keyboard input and just runs the whole code. I put this section of code (the …

Member Avatar for gerard4143
0
109
Member Avatar for eviah

Hi guys, this is my first post here, and I'd love any feedback you guys can give me. I'm writing a basic program that bubble sorts its ints in an array to ascending order, then resorts some of those specific ints to the element of the position they represent. What …

Member Avatar for eviah
0
201
Member Avatar for adarshcu

can anyone prvide me certain project topics in c? i guess i noe c well.. but im findin it hard to get topics to work on ? can anyone suggest me any place for projects or topics for the same? [edit] even c++ topics would be helpful...

Member Avatar for N1GHTS
0
171
Member Avatar for myk45

Hello. i had seen in some places, the following piece of code: [CODE](void *)2[/CODE] Can anyone please tell me what exactly this means? What does casting a void pointer onto a constant as in the above case, signify? Thanks.

Member Avatar for myk45
0
97
Member Avatar for mebrahtom

I recently want to develop an English and three other languages of my country software Dictionary and I can code in C/C++.peple told me that file operation is the best topic for that.BUt I don't have any idea on how to do that. help please!!

Member Avatar for N1GHTS
0
163
Member Avatar for kangkan_14

can anyone please tell me what is wrong with dis code.....i am getting a segmentation fault even though it has been compiled successfully(in a unix system): [CODE]#include<stdio.h> int low,high,mid; void msort(int a[],int low,int high); void merge(int a[],int low,int high,int mid); int main() { int a[10]; int count; for(count=0;count<10;count++) { printf("Enter …

Member Avatar for N1GHTS
0
177
Member Avatar for penny90

[CODE]#include<stdio.h> #include<stdlib.h> #include<string.h> int bin2dec1(char *afterx1); int bin2dec2(char *afterx2); void displayBits(unsigned value); /* function main begins program execution */ int main() { int opcode,dec1,dec2; char oprand1[13]="",oprand2[13]=""; char ones[13]="111111111111"; char zeros[13]="000000000000"; char afterx1[13]="",afterx2[13]=""; printf("Instruction : "); scanf("%d%s%s",&opcode,oprand1,oprand2); if((opcode == 1||opcode == 0) && strlen(oprand1)<=12 && strlen(oprand2)<=12) { if(strncmp(oprand1,ones,1)==0) { strncpy(afterx1,ones,12-strlen(oprand1)); } …

Member Avatar for N1GHTS
0
155
Member Avatar for mjoshi

Hello, I am having trouble with a simple math operation after reading from a file. If a particular condition is met, i am copying a number(7 positions), starting from position 31. My aim is to sum all these numbers when the condition is met. I am testing the code on …

Member Avatar for r.stiltskin
0
186
Member Avatar for USC_Megoy

Hi everyone...Can ask some help with you guyz..I want to study cursor-base but I cant find it in the internet...can anyone help me to explain what is a cursor-base implementation and what are the functions..I saw virtualheap, Mymalloc and myfree function... Thanks for the explanations...More power...

Member Avatar for Martin B
0
131
Member Avatar for GHETTO COWBOY

Hi I'm currently working on a college programming assignment and for this assignment I need to create a contact list of first name and last name and store them as the program runs I may not be able to explain this well but I understand what i have to do …

Member Avatar for csurfer
0
134
Member Avatar for manish7286
Member Avatar for abhimanipal
0
56
Member Avatar for ChainedHollow

I am needing to edit this client/server echo program into a client/server talk application, to send messages back and forth between the client and server, rather than have the client echo the message only. So the output would be: C: Hello S: Hello S: How are you? C: How are …

Member Avatar for ChainedHollow
0
166
Member Avatar for death_oclock

I'm not all that familiar with the C syntax rules, I've mostly worked with C++, and I'm having some weird problems working with Visual C 2008. Here's my code: [CODE=c]#ifndef IFF_H #define IFF_H #include <stdio.h> #include <stdlib.h> #define IDS_GROUP "" #define IDN_GROUP 1 #define IDS_CAT "cat " #define IDN_CAT 2 …

Member Avatar for HHBones
0
222
Member Avatar for Pooch74

I'm trying to learn using pointers, and in the code below I can send variables to a function. But the return is obviously wrong and I can't seem to figure it out. What I want the function to return is the number of even number occurrences. Any suggestions to where …

Member Avatar for Pooch74
0
99
Member Avatar for halil.burak

Salary Works Department for use in a workplace, employees' salaries and to calculate the income tax cuts, the minimum number of net salary payments using money to make and required a program to get some statistical information. For this program the following data will be entered for each employee in …

Member Avatar for halil.burak
0
149
Member Avatar for xaop

Hi, One of my assignment questions is to write a program to illustrate external storage class, extern variable,global variable and thus write the differences between global variable and external variable. My program : [CODE]#include <stdio.h> extern int i; int main() { printf("\n%d",i); inc(); dec(); getch(); return 0; } inc() { …

Member Avatar for xaop
0
92
Member Avatar for achieve_goals

Hi, I am having trouble comparing characters from two strings. This is what I have [CODE] void encrypt(string plaintext, string vigenere_table[length][length], string keyword, string& ciphertext) { int row, col; for(int i=0; i<20; i++) { for(int x=0; x<length; x++) { if(vigenere_table[x][1] == plaintext[i]) //wont let me use == row = x; …

Member Avatar for myk45
0
154
Member Avatar for stud02

hi, Is it possible to load a c file into another c file? I want to give a list of functions used in the c file. If this isnt possible, can i give this list of functions from a loaded text file, when i copy the used c file into …

Member Avatar for WaltP
0
117
Member Avatar for gahhon

[CODE]struct NamesAtt { char student_Surname[20]; char student_givenName[50]; char gender[100]; }Summary; ... void Students_Absence_Report() { system("cls"); printf("Student Presence/Absence Report\n"); printf("===============================\n"); printf(" Name \t\t%%Presence %%Absence\n"); for(i=0; i<student; i++) printf("(%d) %s %s\t %.2f\t %.2f\n", i+1, Summary.student_Surname[i], Summary.student_givenName[i], Presence_percentage[i], 100.00-Presence_percentage[i]); printf("\n"); printf("------- END OF ATTENDANCE REPORT -------\n\n"); system("pause"); system("cls"); } void Barred_Students_List() { system("cls"); …

Member Avatar for N1GHTS
0
215
Member Avatar for DrueY

Can someone explain this short paragraph concerning wave file analysis (what exactly is the input and output?): The default input to this program is a text file containing a uniformly sampled time series, presented as a column of numbers. The default standard output is the magnitude of the discrete Fourier …

Member Avatar for DrueY
0
101
Member Avatar for cbebop7

The file that I am trying to read has the following contents: 192.168.1.1 48111 test.out 100 25 I am trying to use fscanf to read it line by line and storing each line in a variable. This works if I just have a couple of int variables, but it does …

Member Avatar for cbebop7
0
963
Member Avatar for Rahul.menon

Please check out This Output required [CODE] Aa Cc Bb Dd Ee Ff jj Ii Hh Gg [/CODE] [CODE] #include<stdio.h> #include<conio.h> void main() { char a = 'a',a1 ='a',A = 'A',A1='A'; int i,j,n; clrscr(); for(i =1;i<=4;i++,printf("\n")) { if(i%2!=0) for(j = 1;j<=i;j++) { printf("%c%c ",a,A); a++; A++; } else { a1 …

Member Avatar for Rahul.menon
0
107
Member Avatar for quietcity2012

can anyone help me with following bit-wise manipulation.thanks! /* * copyLSB - set all bits of result to least significant bit of x * Example: copyLSB(5) = 0xFFFFFFFF, copyLSB(6) = 0x00000000 * Legal ops: ! ~ & ^ | + << >> * Max ops: 5 * Rating: 2 */ …

Member Avatar for N1GHTS
0
394
Member Avatar for upendrap

hello all, actually i am working on sipmle work inwhich i need to import one file whic is of .hex extension, so i need to import a file which should be exactly same name with .hex extension. how should i implement such that it should take that file name with …

Member Avatar for Martin B
0
80

The End.