15,552 Topics

Member Avatar for
Member Avatar for bucwet

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 …

Member Avatar for bucwet
0
234
Member Avatar for habib_parisa

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; /** # …

Member Avatar for jephthah
0
184
Member Avatar for Takarakujin

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 …

Member Avatar for Software guy
0
81
Member Avatar for johndoe444

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 …

Member Avatar for jephthah
0
182
Member Avatar for johndoe444

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 …

Member Avatar for Ancient Dragon
0
199
Member Avatar for prade

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

Member Avatar for Ancient Dragon
0
167
Member Avatar for Slobodino

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 …

Member Avatar for craig_ka
0
129
Member Avatar for scrappy57

hai friends can anyone give me an example of a program to hash using crypt(3) thanks linux learner.

Member Avatar for jephthah
0
382
Member Avatar for evansjahja

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

Member Avatar for 0x69
0
3K
Member Avatar for ani_joe

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 …

Member Avatar for jephthah
0
89
Member Avatar for geekgirl2011

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 …

Member Avatar for geekgirl2011
0
113
Member Avatar for vegaseat

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.

Member Avatar for mitrmkar
2
217
Member Avatar for Sobakaa

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 …

Member Avatar for Sobakaa
0
132
Member Avatar for Rmitboy

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 …

Member Avatar for Salem
0
152
Member Avatar for scrappy57

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

Member Avatar for jephthah
0
81
Member Avatar for martinjcloud

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 …

Member Avatar for Salem
0
45
Member Avatar for SCMAN2010

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 …

Member Avatar for aspire1
0
148
Member Avatar for dr_michali

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 …

Member Avatar for dr_michali
0
225
Member Avatar for MVB

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 …

Member Avatar for Salem
0
419
Member Avatar for buckkitty

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 …

Member Avatar for Banfa
0
104
Member Avatar for krishna.sv

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 …

Member Avatar for martin314
-1
111
Member Avatar for papia maity

Write a simple program to find the size of differenr basic data types in c.

Member Avatar for Adak
-2
46
Member Avatar for jgehlot09

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. …

Member Avatar for MyrtleTurtle
0
119
Member Avatar for akinso

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 …

Member Avatar for akinso
0
90
Member Avatar for Dream2code

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

Member Avatar for Dream2code
0
158
Member Avatar for sarenameas

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", …

Member Avatar for WaltP
0
6K
Member Avatar for Begginnerdev

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 …

Member Avatar for Ancient Dragon
0
104
Member Avatar for jgehlot09

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 …

Member Avatar for Ancient Dragon
0
64
Member Avatar for SCMAN2010

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 …

Member Avatar for WaltP
0
121
Member Avatar for prushik

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 …

Member Avatar for Banfa
0
198

The End.