15,539 Topics
|
|
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. |
|
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 … |
|
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 |
|
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 |
|
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 |
|
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 != … |
|
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 … |
|
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 … |
|
I created this 2d array consisting of morsecodes: char m[57][6] = {".-..-.", "", "", "", "", ".----.", "-.--.-", "-.--.-", "", "", "--..--", "-....-", ".-.-.-", "-..-.", "-----", ".----", "..---", "...--", "....-", ".....", "-....", "--...", "---..", "----.", "---...", "", "", "", "", "..--..", "", ".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", … |
|
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, … |
|
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; … |
|
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 ; ) |
|
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 … |
|
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 … |
|
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 … |
|
hi all ! please let me know how to extrapolate a 2D image to expand it. thanking you in advance. |
|
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 … |
|
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== … |
|
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. |
|
:) 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 … |
|
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 … |
|
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 … |
|
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 … |
|
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. |
|
/* * 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? */ /* … |
|
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); … |
|
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 ... … |
|
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 … |
|
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 … |
|
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] ( … |
The End.