Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
~7K People Reached
Favorite Forums
Favorite Tags
c x 44
Member Avatar for Cpp_Addict

Hey guys. In C++, if I wanted to read strings into an array I would do this: [code]std::string theWord = ""; for ( int i = 0; i <= SIZE; i++ ) { std::getline ( std::cin, stringArray[ i ] ); }[/code] In C, I am having trouble comming up with …

Member Avatar for urjapandya
0
2K
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
118
Member Avatar for CoolAtt

Hi. am using fgets() to read lines from a text file. the file is being updated after a few seconds. i want to read and process the last appended line at the end of the file. i tried the following: [code=c] while(true){ //infinite loop if(fgets(line,size,fp)!=NULL) process line. } [/code] plz …

Member Avatar for CoolAtt
0
703
Member Avatar for me_ansh

Hi, I am facing a problem, I am accessing a text file through my C program to fetch some values. The problem is that, i want to check whether the text file is updated before opening it, as i want to save the time of opening the file again if …

Member Avatar for Salem
0
142
Member Avatar for slimjimmer

I am trying to produce a program which produces a random array of numbers but I am running into a problem in that when the array becomes even a little large, say 10x10, I get the Bus Error or Segmentation Fault (I think I still get the error with even …

Member Avatar for Salem
0
224
Member Avatar for me_ansh

The man page of 'sscanf' says: "EOF is also returned if a read error occurs, in which case the error indicator for the stream (see ferror(3)) is set, and errno is set indicate the error" I am confused that what kind of read error may occur if sscanf is reading …

Member Avatar for me_ansh
0
87
Member Avatar for death_oclock

Visual C (2008) is acting as if I never included a header file (wave.h) that I am using, but the #include statement is definitely there. Here's my main (BPM analyze.c): [CODE=C]#include "stdafx.h" #include "common.h" #include "sound.h" #include "wave.h" int main(int argc, char* argv[]) { SAMPLE samples[2]; unsigned int i, j; …

Member Avatar for Aia
0
133
Member Avatar for zoner7

I'm currently taking a computer security class. The thing is, I haven't even taken an intro computer programming course. I taught myself a good deal of C++ back this summer, but I hardly know as much as the other students in the class. we were asked to manipulate the following …

Member Avatar for zoner7
0
787
Member Avatar for Logi.

Hi there, I am trying to write a queue ADT using a linked list in C and have hit a snag initialising my queue... [code=c]typedef struct qNode{ int element; struct qNode *next; } qNode; typedef struct Queue{ struct qNode *front; int len; } Queue; Queue create_queue() { Queue q = …

Member Avatar for Logi.
0
181
Member Avatar for encee

i am trying to read a text file like this and store each number as an integer (without the decimals) and print them 1 3 5.6 3 2.1 4 2 2 3 4.2 1 here is what i have now [code=C] #include <stdio.h> #include <conio.h> void main() { int i, …

Member Avatar for me_ansh
0
1K
Member Avatar for Trendkiller

I can't find the error and also C2182 error: illegal else without matching if. [code=c] #include <stdio.h> int main (void) { int count=0; //counter int hours; //hours char choice; //users choice for continuing float total=0; //total charge //print display printf ("%-15s %-10s %-10s","Customer","Hours","Total Charge"); //assinging customer number count++; //ask for …

Member Avatar for me_ansh
0
304
Member Avatar for me_ansh

Hello every one, I have a confusion regarding arrays and pointers, My question is: "Is array name a pointer (rather a constant pointer)"?? I feel the answer is 'yes' because we can use the de-referencing operator(*) with the array name, Also, because array name is a constant pointer so we …

Member Avatar for Narue
0
245
Member Avatar for asharrajpoot

i want to show output like this [code] A B C D E F G F E D C B A A B C D E F F E D C B A A B C D E E D C B A A B C D D C B …

Member Avatar for me_ansh
0
186
Member Avatar for boomtoom

void main() { int number; totalCallsPtr pcall=NULL; getData(&pcall,&number); } void getData(totalCallsPtr* pcall,int* number)//get data from the text file { int i,n; FILE *f1; f1=fopen(INPUT, "r"); if (f1==NULL) printf("File not open!\n"); else { fscanf(f1,"%d",&n); *pcall=((totalCallsPtr)malloc(n*sizeof(CALL))); } if((*pcall=(totalCallsPtr)malloc(n*sizeof(CALL)))==NULL) printf("not enough memory to allocate"); for(i=0;i<n;i++) { fscanf(f1,"%d ",&pcall[i]->day); fscanf(f1,"%d:%d:%d ",&pcall[i]->startCall.hours,&pcall[i]->startCall.minutes,&pcall[i]->startCall.seconds); fscanf(f1,"%d:%d:%d ",&pcall[i]->endCall.hours,&pcall[i]->endCall.minutes,&pcall[i]->endCall.seconds); fscanf(f1,"%c",&pcall[i]->type); …

Member Avatar for me_ansh
0
118
Member Avatar for titosd

Hello, I have a question I should write a program that read words from file text and sort it by ABC letters in array, and ask the user to enter a sentence and chcking if the words in the sentence existing in the array. the program checking all the words …

Member Avatar for me_ansh
0
190
Member Avatar for mohan_198505

hi i m mohan sahu.i m using turbo c( borland compiler) and working with windows xp. i have one header file say myheader.h having only declarations of all functions and one myfunc.c file having only definitions of all function without main and i m including header file with #include "myheader.h" …

Member Avatar for ajay.krish123
0
158
Member Avatar for c_Newbie

hi all, i used the search function, but the threads i found didnt really help me much since i am quite a newbie and didnt understand how it worked. so what i am trying to do seems simple but it doesnt work. i have a textfile with a single line …

Member Avatar for c_Newbie
0
110
Member Avatar for Lilal

Dear Sir/Madam, I'm currently trying to compare a value from an array vs (In the first instance) A set character, and (in the second instance) against a set integer. None of the comparisons are ever returning true even when they appear to be the same on a printf statement, although …

Member Avatar for Lilal
0
116
Member Avatar for Emma1

Hello, Out of fgets() and gets() which function is safe to use and why? Thanks

Member Avatar for Ancient Dragon
0
106
Member Avatar for prashanth s j

Hi all, I am getting a compiler error for the following: [U]The following is the declaration in the header:[/U] void init(INBUFF ** , OUTBUFF ** ); ---->line no 21 [U]The following is the function init:[/U] void init(INBUFF ** inbuffptr, OUTBUFF ** outbuffptr) { ------------------->line no 81 *inbuffptr = (INBUFF *) …

Member Avatar for me_ansh
0
98
Member Avatar for RenFromPenn

Hi, I am working on a program that opens a file, reads the text, converts the text to uppercase, and then displays it on the screen. If I write the program to just type in a string and convert it, it works fine. If, however, I write it to open …

Member Avatar for ajay.krish123
0
138
Member Avatar for arunprabhu.1

Hi all i've a file sysdef.dat which looks similar to this : temp = 43; data = 23; temp2 = 34; ... and it goes on up to some values... how do I read only the values of temp and temp2(i.e 43 & 34) from this file... I've also tried …

Member Avatar for me_ansh
0
80
Member Avatar for kishendra

C PROGRAMMING ASSIGNMENT 1. Express, using pseudo code, the algorithm to compute the nth root of a whole number (for example, the square root of the whole number for is 2). 2. Prepare a flow chart for the above algorithm. 3. The following has to do with the design of …

Member Avatar for me_ansh
0
155