15,552 Topics
| |
Hi all, This is a script that reads in text from a file and separates it into characters. It works fine as long as MAXSTRLEN is under 610000. However, I need it to read in whole books of text. Whenever I try to bump that number up above 610000 or … | |
Dear all, I am writting a code for high dimensional chebyshev interpolation. Since it is high dimensional, I MUST use extremely large arrays. Something like this: [CODE] #define DIM (int)2 #define TOTAL_STEPS (int)30 int main(){ double *a_data; long long a_dim; /** length of matrix a_data **/ int n; /** # … | |
I want to hold user input strings in an array and be able to print it. Is there a way for me to hold string 1 in arr[0], string 2 in arr[1] and so on and so forth? heres what Im thinking [CODE] int p=1, r=3, l=0; char arr[255]; while(p … | |
It is said in many places that comparing two floating numbers for equality can give wrong result and we have to take into account some epsilon value like this float f1,f2; if (f1-f2<epsilon) printf("gotcha"); So what is the reasonable estimate of epsilon? My intuition is that that has to be … | |
how does long and long long differ? The machine I am using has core 2 duo processor. It shows the same size (8 bytes) for both of them. Was short type ever was 1 byte and changed to 2 bytes later on? Was long and int ever was 4 byte … | |
hii i just downloaded a dev c++ compiler...& wrote the basic hello world program...whenever i try to compile ..my quickheal antivirus deletes it as a trojan...please help..i reinstalled it but gives the same result | |
I need an algorithm for the following problem: There's a tree with N fruits each with its own weight w[i] and height h[i]. I can only reach a fruit if it's no taller than H inches. Also every time I pick a fruit, all the other fruits in the tree … | |
hai friends can anyone give me an example of a program to hash using crypt(3) thanks linux learner. | |
Guys, I need help When I compile my code, I get [code]error: invalid operands to binary ^ (have ‘float’ and ‘double’)[/code] Here's some portion of my code: [code=c] #include <stdlib.h> #include <stdio.h> ... float freq; const float key_magic = 2 ^ (1/12); ... freq=440*(key_magic)^(atof(optarg)-49); [/code] Thanks | |
Can anyone tell me the valid priority values? positive or negative??I have two threads spawning from the main() , say thread1 and thread2. thread2 always executes much faster than thread1. I want the other way round, because thread1 is much more important than thread2 in my program. Hence I was … | |
I've got this game almost working. When I run it in my complier is "blows" up at this line: [CODE]if (facesInHand[numberInHand2][1] != 0 && facesInHand[numberInHand2][2] != 0 && facesInhand[numberInHand2][3] != 0 && facesInhand[numberInHand2][4] != 0 && facesInhand[numberInHand2][13] != 0) straight = 1; else straight = 0;[/CODE] and continues through the … | |
Looking at the First In First Out (FIFO) data situation. Just like a line at the grocery store check-out. Its counterpart FILO would be like a stack of dinner plates. | |
Hello, everyone! I have a program (a tcp server for text messages exchange), and i want it to do the following thing: if a port is already in use - choose automatically a new one (via rand() function) and inform me about that. I'm testing it on Solaras 5.9 if … | |
I write a C program that reads a text file and copies it to standard output, adding to the start of each line the line number and the number of characters in the line. For example, if file contained the following: Hello Daniweb forum How are you today? Good day … | |
Hi friends, can any one let me know what hash algorithm is used by linux system for its shadow passwords. I'm totally confused some say MD5 and some SHA-512 which one is true and can give the source for answer if got them. Thanks linux learner | |
Hello, I'm fairly new to C. But my question is simple. I am creating a program that will take in 4 characters from the keyboard(1 at a time). Then it will display these 4 char on one line but in order as they were inputted. (In one print function).What code … | |
I am having problems with my code it says that the value compare is not being intitalized please help. I need to enter seven words total then sort them out.please help. [CODE]// it might work2.cpp : Defines the entry point for the console application. // #include "stdafx.h" /* Inputs a … | |
Hi, Here's a part of the code: [CODE]#define S 1000 /* rows */ #define T 200 /* columns */ int main() { int n, i, j; float **x; x=(float**) malloc (T*sizeof(float*)); for(i=0; i<T; i++) x[i]=(float*) malloc (S*sizeof(float)); memset(x, 0, sizeof(x[0][0])*S*T); return 0; }[/CODE] This was compiled well (gcc) and had … | |
Hey guys. I'm having some issues with my Visual Studio 2008 Pro. I'm trying to compile the following code, included in the link [url]http://pastebin.com/r6WsG5r7;[/url] but, whenever I try compiling the code, I get like 5 erros: The errors are listed below. Why is it that moving certain declarations around changes … | |
Hello! Just wondering if someone might see what is wrong with this piece of code. I am trying to get the number of rows in resultsDaily so that my for loop may start at that number, so as to append the matrix. here are my header files: #include <iostream> #include … | |
please check this script [code]//program to add to 8 bit binory numbers(2) #include<iostream> using namespace std; int binory(int ,int *p); int addbinory(int *,int *, int *); //this is c++ program so if u want convert it c just change your cout to printf and cin to scanf and do nessassory … | |
Write a simple program to find the size of differenr basic data types in c. | |
Below is the code, when it run shows a combination of back-slash and forward slash and by putting them together and printing them shows a stick rotating. The problem is that it is only rotating at a same position I want to move it back and forth in a line. … | |
i want to write a program for reading mpeg-4 file headers to get info such as filetype ,encoder,bitrate,etc.. is there any library of these functions? i tried searching the forums but could find any desirable results ... i aint asking for the code.. jus a little help on which library … | |
In which path gcc resides in IBM AIX.Due to some change change in my .profile the path variable got changed now i am not able to get the path of gcc. please help me | |
I am attempting to put integers from a text file to an array. I am new to C. I have already found the number of lines and opened the file. I do not understand why this does not work: [CODE] for(i = 0; i <= numberlines; i++) { fscanf(f, "%d", … | |
Hello, I am still green to the C programming language. I am writing a multi-dimensional array program to store strings into an array. The program requires error checking to avoid overflow. I am using Visual Studio 2008. I am using a Windows O/S. The program runs fine on the first … | |
I want to create a function in which a text printed just shown for 1 sec then flush and then a new text appear.. basically the purpose is to create a loader...which appers when the data is manipulating..it will show like this. \|/.....when it moves fast ..it looks like a … | |
How do I write this code without the malloc function? [CODE]// 222.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #define N 6 #define MAX_STRLEN 80 void sort(char **a, int n); char *stringArray[N]; int main(int argc, char *argv[]) { int … | |
Hello everyone I am trying to learn about the compilation process. I am working on a pretty simple SDL game, but I know that making games isn't very practical, so I am using the project to learn about other programming aspects as well. One of the things I am trying … |
The End.