15,539 Topics

Member Avatar for
Member Avatar for Tresa

can someone please explain to me 1) the difference between getline and gets(). 2) why sometimes when getline is used along with some other cin statements it skips some of the cin statements. :sad: 3)what exactly does the array of structures do? please help me out with this.

Member Avatar for Tresa
0
97
Member Avatar for dallin

I'm using the abs() function in a probability calculation using float and int variables however I'm getting error messages. What I'm trying to do is get a decimal answer using abs() but it appears to only accept integer variables? How do I get the abs() to give me a a …

Member Avatar for Acidburn
0
92
Member Avatar for dallin

I have a column of floating point data that I need to right justify and align the decimal points. Help. Data looks something like this. 30.768 1.345 .430

Member Avatar for vegaseat
1
5K
Member Avatar for Foxtildawn

help! im trying to input data from a file into an array. I cant figure it out...this is what i have: inData.open(fileName.c_str()); int i=0; while(inData) { inData >> T[i]; i++; size++; } thanks

Member Avatar for 1o0oBhP
0
111
Member Avatar for allomeen

Hi i'm trying to concatenate two char and i keep getting core dumpped: char *user = "name"; char *temp = "USER "; strcat(temp, user); if anybody knows what i'm doing wrong please let me know. Thank u

Member Avatar for Dave Sinkula
0
138
Member Avatar for akila

I have a simple program to figure out the single machine precision (epsilon). According to C, float precision is 1.2e-8, but I'm getting the double precision, 2.2e-16. I can't figure out how else to force single precision? [code] void main(void) { float eps = 1.0f; while( eps + 1.0f != …

Member Avatar for murschech
0
149
Member Avatar for H4_Extreme

Hi all..I need urgent help please because I am going to hav my computer science practicals tomorow and i hav to submit my project tomorrow. I hav made a small graphics program. In the program a person chooses any video cassettewhich he wants to buy and after he chooses the …

Member Avatar for jwenting
0
111
Member Avatar for akila

This may be trivial for most of you, but I've been scratching my head as to how to convert real numbers (ie 5.375) to binary. Actually, I'm trying to convert the real number to 32-bit IEEE binary format, but I'm just working with trying to convert it to binary for …

Member Avatar for Dave Sinkula
0
197
Member Avatar for ysong00

I created this 2d array consisting of morsecodes: char m[57][6] = {".-..-.", "", "", "", "", ".----.", "-.--.-", "-.--.-", "", "", "--..--", "-....-", ".-.-.-", "-..-.", "-----", ".----", "..---", "...--", "....-", ".....", "-....", "--...", "---..", "----.", "---...", "", "", "", "", "..--..", "", ".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", …

Member Avatar for vegaseat
0
90
Member Avatar for Index

Hello everybody, I have a problem with libpng library, I am trying to use my own memory allocation routines. So, as stays in doc, I define PNG_USER_MEM_SUPPORTED and want to use png_create_read_struct_2() instead of png_create_read_struct(). png_create_read_struct_2 takes following parameters: [CODE]png_structp png_ptr = png_create_read_struct_2 (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, user_error_fn, user_warning_fn, (png_voidp) user_mem_ptr, user_malloc_fn, …

Member Avatar for Index
0
173
Member Avatar for kloony

I have the following list-processing interface which I save as .h file. I don't see anything wrong with it but everytime I compile, it says that the declaration in line 2 is missing ";"..........can anyone please help? my code is: typedef struct node *link; struct node{ itemType item; link next; …

Member Avatar for Narue
0
116
Member Avatar for mad_cow01

Hi i'm new here and tommorrow i'll be doing some project in computer science so i need a template/outline of a triangle.h file, thanks in advance ; )

Member Avatar for 1o0oBhP
0
114
Member Avatar for Kate

hi there. I've been battling with this for a while now, and really need some help!! I have five files full of 100 numbers each, they are labelled 1.txt, 2.txt up to 5.txt. I want to read these files in and put them all in an array: `files[5][100]` so I …

Member Avatar for Chainsaw
0
313
Member Avatar for mr_mooz

Hi I have an array of float and i need to mask the values. I want to be able to get arr[x] and arr[x+1] and then mask them and recombine them results in a radom order (im doing an evolutionary algorithm!) But i cant get the masking to work, it …

Member Avatar for Dave Sinkula
0
206
Member Avatar for softball4319

I am trying to input data between two files. I have to input on piece of data from the files at a time and then compare them. Once they have been compared I have to ouput them into a new file so that they are in numerical order. Do you …

Member Avatar for Narue
0
24
Member Avatar for koteeswara

hi all ! please let me know how to extrapolate a 2D image to expand it. thanking you in advance.

Member Avatar for 1o0oBhP
0
201
Member Avatar for crq

can anyone help me with this one? i am getting a syntax error that reads like this: lab2aa.C: In member function `bool IntArray::operator==(const IntArray&) const': lab2aa.C:80: syntax error before `}' token my size() method works (tested it before i put in these operator things) ... and self is *this in …

Member Avatar for Narue
0
148
Member Avatar for cutenature

I am trying to free a memory in the main which has been allocated in a sub-function. Is this possible and am i doing this in the right fashion. The code sample is: char* SubFunction() { char *ptr= NULL; char **values; ptr= (char *)calloc( 100, sizeof( char ) ); if(ptr== …

Member Avatar for Chainsaw
0
100
Member Avatar for xxraveteddyxx

how do floating numbers work exactly...im readin about them but i cant seem to understand there purpose...someone please help..yes im a newbie.

Member Avatar for Narue
0
79
Member Avatar for knight81

:) good day to all... pls i have a report about a certain header file, the alloc.h, but :o i cant see any definition on the web! :?: i only want to know what is the use of <alloc.h>, & what is the advantage using it! please, i really need …

Member Avatar for knight81
0
148
Member Avatar for bhanu

hi I need a program which is to have file containing structure of employee details like deposit(transaction type) , amount and account num written in C and that file had to be sent to client 1 where it got to print the inf then at server it should contain the …

Member Avatar for bhanu
0
129
Member Avatar for Nauro

How can I make a program which will call a program and send some variables to the program and then this new program will run and then return a new set of values. In essence trying to use a program to do the same thing as a function. For example …

Member Avatar for Narue
0
81
Member Avatar for vamp

Is it possible if anyone could help me out. I asked my friend if he could do this, but pointed me here. I have no computer science knowledge/language. I was trying to get a program that hits a certain key every 4 minutes. Than another for minutes later does the …

Member Avatar for Narue
0
116
Member Avatar for scorpion82

Hi all, I would like get Windows XP transfer mode (UDMA, DMA, PIO ...etc) using C language. Is it possible? If possible, can anyone of you please teach me on that? I would like to know the detail of the message return from the function too. Thanks.

0
55
Member Avatar for niamul

/* * Please try to answer this question. There is no time bound. * The following C program segfaults of IA-64, * but works fine on IA-32. */ int main() { int* p; p = (int*)malloc(sizeof(int)); *p = 10; return 0; } >/* Why does it happen so? */ /* …

Member Avatar for niamul
0
166
Member Avatar for JimH

I need to assign a value to a variable named in a sting variable. Like this ... int temperature; int pressure; int volume; int variable_value; char Inbuffer[2048]; printf("%s","Variable List: temperature, pressure, volume"); printf ("%s","Input variable name from list above:"); gets(Inbuffer); ScanError=scanf("%s\n",variable_name); .... printf("%s","Input new value for variable:"); gets(inbuffer); ScanError=scanf("%d", variable_value); …

Member Avatar for JimH
0
188
Member Avatar for akoloff

i want to delete part of a binary file, let's say 12 byte record somewhere in the middle of the file. i can think of only one thing: - put the file pointer on the spot - shuffle all the following records up there're gotta be a better way ... …

Member Avatar for Narue
0
71
Member Avatar for saloo

3. Write a class to encrypt and decrypt a text file. The encryption step is described below: a. Find N, where N is the length of the longest line in the file, or the number of lines in the file, whichever one is higher. b. Find M, where M is …

Member Avatar for alc6379
0
66
Member Avatar for zack_rage

hi i download a compiler from borland site could you please help me with my problem when i run or compile basic programs that i have made it says a error message the stdio.h is not found so that the program has no output any good compilers that can you …

Member Avatar for murschech
0
95
Member Avatar for compeat

hi! I have a class same as below: [CODE] class sample{ friend ostream& operator<<(ostream &ostr,sample p); private: //: //: public: //: //: }; //--------------------------------------------------- ostream& operator<<(ostream &ostr,sample p){ //: //: return ostr; } [/CODE] While the compiler get to line(***) make failed with this error report: [B]type name expected![/B] ( …

Member Avatar for Narue
0
127

The End.