15,552 Topics

Member Avatar for
Member Avatar for RexxX

What way(s) can I reread the same file in C? I've only been able to find C++ tutorials. I tried: [code] fclose(infile); infile = fopen(argv[1], "r"); //error checking [/code] but this code didn't go to the beginning of the file.

Member Avatar for kenji
0
88
Member Avatar for bluebird

hello Is there any way to change numeric to figures? for example if the user input is 134, the program output must be one three four. thanks in advance, Bluebird

Member Avatar for rajenpandit
0
114
Member Avatar for ~s.o.s~

Hello to alll programmers out there. Here i am trying to design a custom pascal triangle where the user can specify the TOP ELEMENT as well as both the CORNER elements. The problem i am facing is that the prog works well till the 3rd row but starts giving rubbish …

Member Avatar for creeping death
0
724
Member Avatar for jenilgandhi
Member Avatar for Dewey1040

I'm trying to complete a radix sort program, and i cant remember the algorithm to get the specific digit out of a number between 1 and 10000 heres the for loop which calls getdigit: [code=C] for( i = 0; i <= 4; i++ ){ printf("Pass %d: ", i ); for( …

Member Avatar for monkey_king
0
108
Member Avatar for s1986

connect() system call fails while client tries to connect to a server givin duplicate name error.Can you please suggest me a way to remove this error? Also I would like to know can we check if a socket is closed or not? how to ensure that a socket is closed. …

Member Avatar for monkey_king
0
94
Member Avatar for yuvaraj.tr

Hi I have doubt . Can we return the some data from boolean Function in C For Example [code=c] bool add( int a, int b) { int C; C = a + b; return C; } [/code] Is it possible in C

Member Avatar for monkey_king
0
127
Member Avatar for death_oclock

My program is getting hung up somewhere in the function [ICODE]evolveRealization[/ICODE] and while it is stuck its memory usage is increasing by around 1MB per second! While it is building up generations, it was designed to only use the most recent one, and the old ones should be freed. So …

Member Avatar for Ancient Dragon
0
148
Member Avatar for bharavn

I am new to Turbo C can anyone tell me how to create a project of muLtiple .c and .h files in Turbo C, and also how do you combine all the files at once?

Member Avatar for ArkM
0
112
Member Avatar for stickboy

Hello I know I may receive some grief for not inserting code correctly it is my first post... My question is this: I am reading a huge list of values from a file and I need to store these elevations into an array so they can be used to calculate …

Member Avatar for stickboy
0
252
Member Avatar for moonw3ll

[code] #include <stdio.h> #include <string.h> #include <conio.h> #define MAX 17 #define TAX_RATE 0.12 #define LENGTH 30 struct menuItemType { char menuItem[LENGTH]; float menuPrice; int numOrdered; }theMenu[MAX]; void Menu(void); int getData(int); void overView(void); void initialize(void); int order(void); float pbill=0; float bill=0; float totalTax=0; int main(void) { int choice=0; char end; initialize(); …

Member Avatar for moonw3ll
0
151
Member Avatar for lostinC

This program needs to create, sort, and search a novel array. Each novel in the collection will have the following attributes: Title Author Publishing Year Number of Pages The novels I will be sorting are in a file called data.txt I need to use bubble sort to sort the array …

Member Avatar for nucleon
0
134
Member Avatar for nexusdarkblue

Hi everyone, It seems my struggles with structures have continued. In my current program, I'm trying to pass an array of structures into a function. I've declared my structure in a separate header file using [B]typedef [/B]to define a new type called 'flight'. But when I try to compile my …

Member Avatar for nucleon
0
238
Member Avatar for Ganahonic

[CODE]#include<stdio.h> int function() { int test1; int test2; addit(test1 + test2); return(0); } void addit(test1 + test2) { printf("Sum is: %d",test1 + test2); }[/CODE] Whenever I define a void function in C with an operator in the parameters, I always get the error: error: expected ')' before '+' token How …

Member Avatar for Dewey1040
0
78
Member Avatar for Dewey1040

i half understand this code, just wondering if anybody could give me helpful tips/hints about understanding the difference between these two functions [code=C] extern status traverse( list L, status ( *p_func_f )() ){ if( empty_list ( L ) ) return ( OK ) ; if( ( *p_func_f ) ( DATA( …

Member Avatar for Ancient Dragon
0
99
Member Avatar for sayeediqbal

Dear All please read below my test C code. The ins_inv() picks Value of :cds but did not pick :xyz value though it is populated in find_sp_inv() function. [code] varchar cds 11; varchar xyz 30; varchar fxo 11 main(argc, argv) int argc; char **argv; { find_sp_inv (); ins_inv(); } find_sp_inv() …

Member Avatar for Narue
0
78
Member Avatar for NRaf

I was wondering if the following fuction is a safe way to get input from a user (with a specified length). [CODE=c]char *input(int inputSize) { char str[inputSize + 2]; /*DO STUFF HERE (i.e. GET INPUT, CHECK IF CODE IS CORRECT, ETC*/ return &str[0]; }[/CODE] Is there anything that can go …

Member Avatar for Narue
0
104
Member Avatar for riahc3

Hey In VS, you can in a struct do: [code] struct test{ int tes; }tt; [/code] then when I put tt., it would display the all fields in a tooltip which in this case would display tes. Is "IntelliSense" (I know it is not called that) in wxDev-C++?

Member Avatar for mitrmkar
0
119
Member Avatar for tksrules

Hi, I am comfortable in c.But i find errors here in my code.I know its related to that structures cant be accessed outside main().Need s use of pointer.How to do?.Help me soon. A revised code will be of help. [code=c] #include <stdio.h> #include <string.h> struct phonebook { char name[100]; long …

Member Avatar for John A
0
101
Member Avatar for death_oclock

I had forgotten about calloc for the longest time, but I was recently reminded of it. Now i'm curious, what would be the difference between [ICODE]malloc(numElems * elemSize);[/ICODE] and [ICODE]calloc(numElems, elemSize);[/ICODE]? If my knowledge of arrays is correct, there shouldn't be any difference in the memory allocated.

Member Avatar for death_oclock
0
133
Member Avatar for codeman85

This program needs to create, sort, and search a novel array. Each novel in the collection will have the following attributes: Title Author Publishing Year Number of Pages The novels I will be sorting are in a file called data.txt I need to use bubble sort to sort the array …

Member Avatar for ArkM
0
92
Member Avatar for Lilal

Heya, Just trying to get a little help on some excercises I need to do, Done 14/15 fine, but stuck on 15th and not sure quite whats wrong. Need to do a systemcall from C program to copy a file, using stat, open, read write and close. So far I've …

Member Avatar for Lilal
0
96
Member Avatar for me_ansh

Hi all, I want to find the size of proc file using C....can somebody help!!!!

Member Avatar for MosaicFuneral
0
119
Member Avatar for karthik.c

hi guys i've problem in tcp:client/server program when i run it: this program is to print the contents of a file in other m/c connected to LAN im sure that i've given the correct IPAdress,and also path of the file in other m/c but still its not printing the contents …

Member Avatar for Ancient Dragon
0
173
Member Avatar for yuvaraj.tr

Hi friends i am doing the snake game program for Set top Box . I am Facing problem when i get the remote control keys. if i press the up,down,right,left keys when program is running ,program does not response .once game is over then it is taking the values from …

Member Avatar for nucleon
0
99
Member Avatar for pinky yohana
Member Avatar for jam123

Hi everybody, Im a new member on this forum and I want ur help on C language. Im a new student on this language & mostly we study it by our-selves. This is the question: > One of the academic staff is trying to keep track of the students and …

Member Avatar for Alibeg
0
140
Member Avatar for vishy_85

hi all, im having some problem , returning the buffer array to the main function, im new at this , i need to print the currentdate from the main function, is thr any way i can return the date to the main function ?? [code] #include <sys/time.h> #include <time.h> #include …

Member Avatar for Narue
0
96
Member Avatar for leebria

Newbie to C programming here. I am trying to convert a char array into individual hex values and store them in an unsigned char array. Basically I have "3www6google3com0" and I would like to get the 8 bit hex value for each individual character from the string. I would like …

Member Avatar for leebria
0
963
Member Avatar for deepugtm

I want to write a program that can run a file in my hard disk.For example,a test.bmp file is there in location D:\home\test.bmp,that program should open(like double clicking on it ) that file (test.bmp) and i can view the image contained in the file.

Member Avatar for csurfer
0
136

The End.