15,540 Topics

Member Avatar for
Member Avatar for ayoub

my problem is that i have written an algorihtm to convert non deterministic finite automata to deterministic finite automata but i couldn't translate it to C program and this is the algorithm i have written qx is a state in the NFA and q0 is its start state QX is …

Member Avatar for WaltP
0
2K
Member Avatar for SHASHWATH
Member Avatar for rithish
-1
70
Member Avatar for SHASHWATH

Spiltter function split the sample.c program into 3 parts sample.dat.1 sample.dat.2 sample.dat.3 if its memory size is 300 and splited file wil hav 100 respectively . . And join function is opposite of it. . Its in unix example split -c <size> filename for join join file

Member Avatar for Ancient Dragon
0
110
Member Avatar for rithish

#include <stdio.h> #include <stdlib.h> int i=-1; main() { int a[30],n; printf("enter the no of terms: "); scanf("%d",&n); store(a,n); } int store(int a[],int y); { if(i==y) { return \\it should return and terminate exit(0); } i++; printf("enter the number: "); scanf("%d",&a{i]); store(a,y); i know i had made a mistake but where …

Member Avatar for rithish
0
159
Member Avatar for rithish
Member Avatar for deceptikon
0
126
Member Avatar for gem.gonzales.9

` #include<stdio.h> main() { int b,c; printf("enter c :"); scanf("%d",&c); printf("enter b :"); scanf("%d",&b); printf("%d", gem()); getch(); return 0; } int gem(int b,int c) { int a; a=b+c; return a; } `

Member Avatar for rithish
0
137
Member Avatar for milindchawre

#include<stdio.h> #include<conio.h> #include<stdlib.h> main() { char ch1[20],ch2[20],*temp[10]; int i,j,count,k,p,q,len1,len2; printf("Enter the string\n"); scanf("%s",ch1); printf("Enter the string to be found\n"); scanf("%s",ch2); for(i=0;ch1[i]!='\0';i++); len1=i; for(j=0;ch2[j]!='\0';j++); len2=j; k=0; count=0; for(i=0;i<len1;i++) { if(ch1[i]==ch2[0]) { temp = &ch1[i]; k++; } } for(i=0;i<k;i++) { for(p=0;p<len1;p++) { for(q=0;q<k;q++) { if(*ch1[p]==*temp[q]) { for(j=0;j<len2;j++) { if(ch2[j]==ch1[p]) p++; if(ch2[j+1]=='\0') { …

Member Avatar for deceptikon
0
122
Member Avatar for dinohead

a simple question, i just can't get around at the moment - if i may if unsigned char *s = 42006f, how can I split/select the hex value into its pairs i.e 42/00/6f using portable ansi c. thanks!!

Member Avatar for WaltP
0
108
Member Avatar for keryll

hi i am making a Bcd to Binary conversion can somebody help me lessen the code? thanks. //! Converts a two-byte, 3-digit, BCD number into a binary value. extern uint16_t BcdBin( const uint8_t* const pBcdBin); //uint16_t BcdBin(const uint8_t * const pBcdBin) int main() { int Num; int A=0,B=0,C,D,E=1; int F[100]; …

Member Avatar for WaltP
0
223
Member Avatar for vikingsheepman

Hello all! I have used this forum many times in the past to solve a variety of programming related problems, but am truly stumped on a segfault within a binary search tree. I have isolated the segfault to a fscanf statement that look legitamate to me. The following code blocks …

Member Avatar for vikingsheepman
0
262
Member Avatar for I_m_rude

I request every body on DAniweb.com that please , if any body knows about segment tree, then please either explain me it's update, making otherwise give me solid links so that i can learn from there. IT'S REALLY PATHETIC SITUATION AS I AM NOT GETTING THIS FROM WEEKS. PLEASE IT'S …

Member Avatar for I_m_rude
0
94
Member Avatar for gwolf1

Can someone help me complete my code? I am having trouble with it and I need some input. //#include "bigint.h" #include <stdio.h> #include <stdlib.h> #include <assert.h> #include <string.h> /* Create and implement a bigint data structure that can represent integers whose size is limited only by the memory capacity of …

Member Avatar for gwolf1
0
253
Member Avatar for dinohead

Hello I need to do it in ansi c Can't seem to get it to work at the moment. unsigned char *s scanf("%x", &s); I then want to do if statements based on the amount of characters contained in the variable s. Whats the easiest way to get this? An …

Member Avatar for rithish
0
134
Member Avatar for alaa sam

Hi everyone well currently I am working on a simple malloc and free implementation but I am facing some problems . I get a segmentation fault this is my output inserting node 0 0xc87000 inserting node 1 0xc87014 inserting node 2 0xc87028 inserting node 3 0xc8703c inserting node 4 0xc87050 …

Member Avatar for alaa sam
0
209
Member Avatar for dawsonrose

Hello, I've a file which contains names and grades of students, and I'd like to write a program which can sort their grades (like midterm 1,midterm 2) according to user choice. I wrote as far as the choice part and opening the file, yet I don't know how to make …

Member Avatar for WaltP
0
773
Member Avatar for kesuke

Can I use semaphore or mutex on MikroC? If you know , please tell me the function name or exsample code.

Member Avatar for I_m_rude
0
102
Member Avatar for piero.costa

Hi guys, I'm learning C and I still don't have some concepts very clear in my mind. I have to create a program that get the values from ARGV[] and puts into a vector: the program would work like that: ./program file1 file2 file3 My idea was to do something …

Member Avatar for Ancient Dragon
0
4K
Member Avatar for Graphix

Hello everyone, I stumbled upon a video about the monty hall problem, which I found very well explained, and a lot of comments below the video that were against the conclusion that it **is better to switch**. To clarify, I wrote this small program that simulates the game and allows …

Member Avatar for WaltP
0
641
Member Avatar for manishanibhwani

int n; scanf("%d\n", &n); printf("you typed %d\n", n); it seems to hang until I type one extra line of input....Can anyone explain this behaviour

Member Avatar for WaltP
0
174
Member Avatar for shanki himanshu

struct node { int info; node *left,*right; }; int main() { struct node *root; root = (struct node*)malloc(sizeof(struct node)); root->info=NULL; root->left=NULL; root->right=NULL; if(root==NULL) printf("%d",root->info); return 0; } why it doesnt print root->info?

Member Avatar for I_m_rude
-1
154
Member Avatar for matt.malone.921

Develop a program to meet the following requirements: 1. Must use at least two functions, not including Main 2. Must use indirection (the * operator) 3. Must use a loop 4. Must use an array to hold the integers 5. Must take the integer inputs from a file Your assignment …

Member Avatar for Vish0203
-1
157
Member Avatar for I_m_rude

Can you please give me link for this tree ? I have searched alot and alot , but i am not getting how to implement it or how to use it. please give me links. it's a request to all of you. thanks.

Member Avatar for I_m_rude
0
116
Member Avatar for matt.malone.921

#include <stdio.h> main() { FILE*fp ; if ((fp = fopen("new.txt","r")) == NULL); { printf("file could not be opened\n"); return 0; } } this is what ive written and it always comes back with file could not be opened. I need to read the text file new, which has 10 variables …

Member Avatar for Sokurenko
0
87
Member Avatar for titusnainggolan

I have the code below #include <stdio.h> int main(){ float n; scanf("%f",&n); printf("%f",n); return 0; } Then, I run the code input: 45321.56 is not same with output:45321.558594 I want to get output which same as the input. How to solve this problem? Thank you

Member Avatar for WaltP
0
362
Member Avatar for Vish0203

How can i give an icon to the exe file produced after executing my code?? is it possible??

Member Avatar for Vish0203
0
111
Member Avatar for dinohead

Hello! I have what I want to print to file current printf-ing on my console. Can I have some help getting it to do the same, only this time to file please. I can't get it to work. Many thanks for(i= 0; i <= k; i++) { add = (unsigned …

Member Avatar for deceptikon
0
156
Member Avatar for tonkata_stoilov

Absolutely new to C. I just downloaded Code::Blocks with MinGW and tried to build my first piece of code and I got this strange message: Linking console executable: bin\Debug\intro1.exe Execution of 'mingw32-g++.exe -o bin\Debug\intro1.exe obj\Debug\main.o' in 'D:\Documents\intro1' failed. Nothing to be done. And I don't know what to do. Any …

Member Avatar for gusano79
0
236
Member Avatar for chaacoali

Can someone please tell me what is wrong with this code int main() { char str[10],str2[10]; int k,i=0,j; printf("enter de string\n"); scanf("%s",str); k=strlen(str); printf("length of de string %d\n",k); for(j=k-1;j=0;j--) { str2[i++]=str[j]; } printf("%s",str2); for(i=0;i<k;i++) { if(strcmp(str,str2)==0) { printf("palindrome"); } } return 0; } this is my output enter de string …

Member Avatar for chaacoali
0
127
Member Avatar for gem.gonzales.9

#include <stdio.h> #define p printf #define s scanf main() { int q,num[2000],sum,i,a,b; float mul,t,grade,quiz,d; { p("enter the the total quiz:"); s("%f",&t); p("enter the no. quiz:"); scanf("%d",&q); p("enter five no sepeerated by enter :\n"); for(i=0;i<q;i++) s("%d",&num[i]); sum=0; for(i=0;i<q;i++) sum=sum+num[i]; p("the sum of array :%d",sum); mul=sum/t; p("\ntotal:%f",mul); grade=mul*100; p("\n total is: %f",grade); …

Member Avatar for Vish0203
0
112
Member Avatar for KasmIR

Hello, I try to compilate this progam! It return "Error 4 error C2664: 'LoadLibraryExW' : cannot convert parameter 1 from 'char *' to 'LPCWSTR' c:\users\andrei\documents\visual studio 2010\projects\test\test\test.cpp 282 1 test Error 3 error C2664: 'LoadLibraryW' : cannot convert parameter 1 from 'LPCSTR' to 'LPCWSTR' c:\users\andrei\documents\visual studio 2010\projects\test\test\test.cpp 200 1 test …

Member Avatar for deceptikon
0
243

The End.