15,540 Topics

Member Avatar for
Member Avatar for gourav1

hi. i want to print all the possible combinations of a string entered. for example:- string input is "abc"... then output is "abc bac acb bca cba cab" and it must be true for every length of string.. i have tried many times and applied as much logics i can. …

Member Avatar for subith86
0
101
Member Avatar for ishanatmuz

I want to know how to download a file using c ? For copying a file in c I do this. [code=c] #include<stdio.h> #include<conio.h> int main() { FILE *inf, *ouf; char ch; inf = fopen ( "file1.ext" , "rb" ); ouf = fopen ( "file2.ext" , "wb" ); while( !feof …

Member Avatar for rubberman
0
293
Member Avatar for yinyue

: : [CODE]void detectFaces(IplImage *img) { /* detect faces */ CvSeq *faces = cvHaarDetectObjects( img, /* the source image */ cascade_f, /* the face classifier */ storage, /* memory buffer, created with cvMemStorage */ 1.1, 3, 0, /* special parameters, tune for your app */ cvSize(40, 40) /* minimum detection …

Member Avatar for Narue
0
207
Member Avatar for c_learner

Dear All, I'm new to C, and would appreciate your help about the below code. The purpose of the program is to multiply the elements of the array and print the result. The user enters the value for how many elements he wants to have multiplied, and then the function …

Member Avatar for c_learner
0
2K
Member Avatar for Varun Bhat

[CODE]#include<stdio.h> #include<conio.h> #include<stdlib.h> #include<string.h> #include<time.h> void main() { int i[100]; int j[100]; int k; int m; clrscr(); printf("Enter the number of questions needed:"); scanf("%d",&m); if (m<=100); { i[100]=rand()%m; printf("%d \n",i,rand()); j[100]=rand()%m; printf("%d",j,rand()); i[100]=rand()%m; printf("%d \n",i,rand()); j[100]=rand()%m; printf("%d",j,rand()); } getch(); } [/CODE] I want to generate random numbers when I press …

Member Avatar for WaltP
0
161
Member Avatar for annonymous21

I have been working on this for some time and need some help. I have posted to another forum with no results. I figured i would try here and see if i can get some real help. I am trying to populate an array with the contents of a file …

Member Avatar for annonymous21
0
323
Member Avatar for Despairy

Hi, i have a client which reads from the socket: [CODE] for (index=0;index<SCALERS;index++) { read(my_socket,vectorScalerPointer,BUFLEN); read(my_socket,resultScalerPointer,BUFLEN); sum+= atoi(vectorScaler)*atoi(resultScaler); }[/CODE] and a server program which writes to it. [CODE] for (index=0;index<SCALERS;index++) { sprintf(ascii,"%d",(*matrixStruct)._vector[0][index]); write(fd,ascii,BUFLEN); sprintf(ascii,"%d",(*matrixStruct)._mat[atoi(whichRow)][index]); write(fd,ascii,BUFLEN); }[/CODE] now the problem is the programs are in a "race condition" usualy the server …

Member Avatar for Despairy
0
168
Member Avatar for anita_86

Hi again!And happy new year to all.Just got to attained an interview and was asked about some c questions.Would like to know what does these lines means?Can anyone tell me? [CODE]int main() { int k=printf("Hello"); return 0; exit(10); } [/CODE] I got answeres like [QUOTE]You're outputting "Hello" on the screen …

Member Avatar for anita_86
0
155
Member Avatar for wickedQuasar

I have to sort a large array of numbers wherein the numbers are random and range from 1 to 9,99,999...till the time the length of array is less than 2,00,000, all sorts work fine (i tried selection, insertion and quick sort)...but when the length of array is increased to 3,00,000 …

Member Avatar for wickedQuasar
0
399
Member Avatar for agniputra

Hi can u pls tel me how to tackle a problem like this: 1234567890123456 is the number to be loaded in db... i need to convert it to double without using atof()... if i use atof() function the number is rounded off to 1234567890123460... ??? can anyone suggest for a …

Member Avatar for dannyniu
0
731
Member Avatar for Lillylionhert

I am working on a Priority Based Scheduler which reads the process in from a file. I have it reading from file and printing to the screen. I'm trying to use strtok to tokenize a line from the process test file and store it in three different arrays. The layout …

Member Avatar for Lillylionhert
0
4K
Member Avatar for mk.hashmie

I have just started learning C language. I am finding problems in nested loops and arrays. how can i learn them?? i am really getting problem

Member Avatar for mk.hashmie
0
75
Member Avatar for jeffwang66

Hi,guys: I put 15 struct variables into a continuous memory at first by using memcpy(). And then I want to print out the element of first struct variable. The correct value is 1, but sometimes "0" is printed out. I do not know why. Can someone who is familar with …

0
74
Member Avatar for IcantC

Hi there, I am trying to compile devcpp project that contains one source file helloworld.cpp [CODE] #include <iostream> using namespace std; int main () { cout << "Hello World!"; system("PAUSE"); return 0; }[/CODE] I get this error: [ICODE] C:\Dev-Cpp\Makefile.win [Build Error] [helloworld.o] Error 1 [/ICODE] Compile log is as follows: …

0
132
Member Avatar for Majoni

When reading characters from standard input what does it mean when you are asked to sop on hitting EOF in the input?

Member Avatar for gourav1
1
351
Member Avatar for permutations

Hi! I am trying to figure out a way to store all tokens of a sentence into an array except the token 'done' which is the last word of the sentence, but not part of the sentence itself (it is purely there to signify the end of the sentence). After …

Member Avatar for x_bharg
0
3K
Member Avatar for kartik bodala
Member Avatar for cvanithakpm

hi any one help me.. in this pgm if i use pointer in name means it correctly working, but by using array to name it doesnt work properly... it shows lvalue required.. by using array i need to run this pgm.... plz help me... main() { type def struct { …

Member Avatar for zeroliken
0
98
Member Avatar for Xinen

Let's say I input the letter: c it will show: c - cat How do I do that? Thank you!

Member Avatar for Adak
0
135
Member Avatar for joy39

i have got a project where i have to connect c program to mysql database. but, i have zero knowledge of mysql. so, iwas looking for a mysql tutorial with c language . but. most of the tutorials online are mysql with php. so, could you please provide me some …

Member Avatar for L7Sqr
0
116
Member Avatar for tubby123

Hello people, I want to write a program which does the equivalent of going to google and searching for a word. So, for example, instead of going to google and typing out 'daniweb', I want to do that from a program. Does google offer any api's for that ?

Member Avatar for tubby123
0
81
Member Avatar for asrockw7

I want to make a simple chat program after I got my first winsock program to work. The thing with chat is that the receiving part seems to work simultaneously with the sending part, but the thing is `recv()` seems to hold until it receives something(like any stdin function, I …

Member Avatar for nezachem
0
154
Member Avatar for ben25x

This code prints coordinates for a square that another program uses. For space's sake I have cut out all the other program's code, but I believe it is a simple syntax mistake with my if() statements. I have followed the rules and looked just about everywhere and followed all of …

Member Avatar for Adak
0
171
Member Avatar for Wolter888

[CODE]/******************************************************************************\ \******************************************************************************/ /******************************************************************************\ Include files \******************************************************************************/ #include "LPC214x.h" #include "pll.h" #include "vic.h" #include "Keys.h" //#include "armboard3.h" #include <math.h> #include "window.h" #include "adda.h" #include "sine.h" /* INITIALISATION COMPONENTS */ #define BufferSize 1024 // size of the buffer for // cosinus or sinus signal #define Threshold 10432 // threshold value for vector …

Member Avatar for thines01
0
411
Member Avatar for domatessuyu

First,im sorry my bad english.I hope,i can tell my problem. there is a string: dizi[5]={1,2,3,4,5} and when program run, i want to change random place of members.i mean; first time program running: dizi[5]={2,4,1,3,5} second time program running: dizi[5]={5,3,1,2,4} 3th program running: dizi[5]={4,2,1,3,5} . . . etc.. always changes random.how i …

Member Avatar for NP-complete
0
88
Member Avatar for kartik bodala
Member Avatar for chhabraamit

Hello guys , I am looking for a HTML parser in C/C++. I am trying to make a movie rater , which take name of movies from a folder and stores it in a file , then sort it according to their rating on net. So ,I am thinking to …

Member Avatar for thines01
0
512
Member Avatar for abhishekjha

[CODE]#include<stdio.h> #include<math.h> int main() { float a,x,y,w,g,s,area,b,c,hg,radius,ho; printf("enter the value of one side:"); scanf("%f",&a); printf("enter the lengths:"); scanf("%f%f",&x,&y); w=2*x; g=2*y; s=(a+w+g)/2; area=3*sqrt(s*(s-w)*(s-g)*(s-a)); printf("the area of the triangle is:%f",area); b=(2*area)/(3*(w+x)); c=(2*area)/(3*(g+y)); radius=(a*b*c)/(4*area); ho=sqrt((9*radius*radius)-(a*a+b*b+c*c)); hg=(2/3)*ho; printf("the diatance is:%f",hg); system("pause"); return 0; } [/CODE] the area comes right but the distance hg shows …

Member Avatar for adityatandon
0
89
Member Avatar for vegaseat

Folks have asked numerous times for a code snippet of a binary search of an array. Here is heavily commented code with a few test printf() included to give you a picture of what is going on.

Member Avatar for codinghavok
1
749
Member Avatar for gourav1

[CODE]#include<stdio.h> unsigned long int call( unsigned long int); int main() { int t=0,i; unsigned long int n; // scanf("%d",&t); while(t==0){ scanf("%lu",&n); printf("%lu\n",call(n)); //t--; } } long unsigned int call(long unsigned int n) { long unsigned int a,b,c,x,y,z,m,l; a=n/2; b=n/3; c=n/4; m=a+b+c; if(m>n) { x=call(a); y=call(b); z=call(c); l=x+y+z; if(l>m) return (l); …

Member Avatar for gourav1
0
304

The End.