15,552 Topics
| |
hi! i'm new here in daniweb.so pardon me for disturbing you all.lol i would like to present you a little problem. i want to design a program that will generate wnted number of arithmetic statements and it would be answered by the one who will use it. and at the … | |
[QUOTE]when i tried to copy structure array of name into another string array i get this error message warning: passing argument 1 of 'strcpy' makes pointer from integer without a cast [/QUOTE] [CODE] /* copying structure array name into another string array*/ #include<stdio.h> #include<string.h> int main(){ int i=0; int j,k,l,m; … | |
`I am trying to limit the amount of characters that a user can enter for the address(/ in the input buffer): for example (if maximum allowed input was 30 then ): ->4 Mary drive lane, Mt. Pyle, A<- when the user typed that I am trying to get the curser … | |
I have a question can you help me?? In this assignment you are going to design and implement a Dictionary system that enables the user to efficiently add, remove, and search for words using a menu-driven system. The words will be organized as shown in figure 1 below. As you … | |
[QUOTE][QUOTE] even after passing all name to bubble sort i get result of unsorted nams..so please help me in this issue [/QUOTE][/QUOTE] [CODE] /* enter customer detail in structure and put its name in asscending order*/ #include<stdio.h> #include<string.h> int main(){ int i=0; int j,k,l,m; int choice=1; char temp[10]; char words[20]; … | |
Hi, Can someone elaborate why the following (the if conditional) differs [CODE=c] int main(){ const char *filename = "test.txt"; int ifd; if((ifd=open(filename,O_RDONLY))<3) err(EX_NOINPUT, "%s", filename); fprintf(stderr,"ifd is:%d\n",ifd); off_t bytes_in = lseek(ifd, (off_t)(-4), SEEK_END); return 0; } [/CODE] vs [CODE=c] int main(){ const char *filename = "test.txt"; int ifd; if(ifd=open(filename,O_RDONLY)<3) err(EX_NOINPUT, … | |
The program is to output the total amount for cinema ticket of different category. I compile it with no error but the window disappears when i enter number of ticket. Can someone help me check what's wrong with my code or formula? Totally idea with it :( [code]/*Cinema Ticket Ordering … | |
I've been programmin on and off for some time. But today I saw something I hadnt seen before Some thing like [CODE=c] void error OF((const char *msg)); void gz_compress OF((FILE *in, gzFile out)); #ifdef USE_MMAP int gz_compress_mmap OF((FILE *in, gzFile out)); #endif void gz_uncompress OF((gzFile in, FILE *out)); void file_compress … | |
Lets say I have two functions that I want to run simultaneously for different purposes as example a function handles an XML RPC requests and the other function handles an IRC connection to an IRCD. what my goal would be to avoid program hang ups on user requests. Is pthreads … | |
Hi guys, I'm pretty much a C newbie, but I've dabbled in other languages over the years. For my current project I'm using mikroElektronica Pro C on a PIC microcontroller. I've got a 2-dimensional array defined like this: [CODE]const char FONTTABLE[96][5]= { {0x00,0x00,0x00,0x00,0x00}, {0x00,0x00,0x5f,0x00,0x00}, {0x00,0x07,0x00,0x07,0x00}, /** [90 rows snipped] **/ … | |
How can I do it - with pointer and only one loop ? for exmpl function - unsigned int dif(const char *str) [CODE] counter = 0; for(i = 0; i < N; i++) A[i] = 0; do { A[tmp % 10]++; tmp /= 10; } while(tmp); for(i = 0; i … | |
[below structure contains s1[i].name contain array of string name. to check if user entered name in that array list. i need to compare words by words. but my problem is that since string is stored in array. and string itself is an small array. so i dont know how can … | |
Want to merge multiple text file items into a single text Please give code Thanks in advance Imran Ahmed <EMAIL SNIPPED> | |
Please I have a little problem with my project. It goes "A polynomial of degree n is represented as Pn(x)=A0 + a1x + a2x^2 + … + anx^n Where a0, a1, a2, a3 , … , an are constant coefficients. Evaluation of such polynomials may be important if Pn(x) is … | |
how can i do it with one loop? [code] void printMat(const int mat[][N], int n) { int i, j; for(i = 0; i < n; i++) { for(j = 0; j < N; j++) printf("%3d ", mat[i][j]); puts(""); } }[/code] | |
Hello, I'm quite new to C programming, the code below tries to print the last 10 lines of a file, My problem is in the last part of the function tail_file() : strcat(tail, character); i'm reading the file character by character, but i want to return a string containing all … | |
Hello! I have a question in regards to [I]malloc[/I]/[I]calloc[/I] and [I]free[/I] in C. What I'm unsure about is the "depth" (for lack of a better word) that [I]free[/I] operates to. I know that sounds strange so let this example hopefully explain what I mean: [code=c] #include <stdlib.h> int main () … | |
......................... please helpe me : i can't write a program ??????? consider the following list of countiers and capital : Canada Ottawa England London India New delhi Italy Roma Japan Tokyo Mexcico Mexico city Chaina Beijing United state washington Russia Moscow Germany Brlin write c programming that will accept the … | |
hi, am doing a project which needs speech recognition..my guide wants me to do it either c or c++ on my own..a basic recognition is even if english alphabets are recognised is enough..but i dunno how to start and where to start..first of all is t feasible..pls anyone help me..if … | |
Hi , I want to write a program on Lexical Analyzer: which finds the no of keywords, no of operators ( based on the classification arithmetic, logical,....), constants, and others. please suggest me one good method. i am using a method which follows as below: char *Arith_Oper[]={ "+", "-", "*", … | |
[url]http://www.daniweb.com/code/snippet216679.html[/url] This code is read an integer from user. is there any way, tt i can using char datatype variable to accept text only. text maximum is 30letter include string/spare. It also will do a check on the char array whether is text only. i've google around but no answer. … | |
Cant seem to figure this one out,,,, although I have been trying for several hours and cant seem to find any good examples on the [url]WWW..[/url]. I am attempting to write a program that prints the command-line arguments of a program... I did find a example that gives the Name … | |
how the sizeof array is the total number of elements multiped by its base data type size, when the name of the array gives only the base address. [ICODE] int array [5]; sizeof array ; [/ICODE] gives 20 bytes. why not 4 bytes. because [ICODE] array = &array[0] .[/ICODE] | |
Hello friends, I have a code snippet related to pointer increment and decrement. [CODE]int arr[] = {1,2,3,4,5}; int *ptr; ptr = arr + 2; printf("%d %d %d %d %d %d\n",ptr,(ptr+1),ptr--,ptr,ptr++,++ptr);[/CODE] It is giving console output as: [B]1245020 1245024 1245024 1245020 1245020 1245020[/B] I am a bit surprised with the third … | |
This is a [inlinecode]strtol[/inlinecode] version of [url=http://www.daniweb.com/code/snippet353.html] Read an Integer from the User, Part 2[/url]. | |
Hi, How can i use code of C with graphics of visual studio. The graphic should be of visual studio and i can write codes in C. How to do? Kindly help me. | |
Please I have a little problem with my project. It goes "A polynomial of degree n is represented as Pn(x)=A0 + a1x + a2x2 + … + anxn Where a0, a1, a2, a3 , … , an are constant coefficients. Evaluation of suc polynomials may be important if Pn(x) is … | |
i tried to pass one number by one within given range from for loop to while loop to check for armstrong. but the value passed from for loop into while loop is not accepting. so any suggestion [CODE] /*program to find armstrong within a given range */ #include<stdio.h> #include<math.h> int … | |
Hi, I wanna generate a software, which should read a C file and check for some rules. I mean, some lines will be syntactically correct according to C compiler. But logically sm lines will be wrong. I wanna detect such lines using this software. Please help me how to start … | |
I'm still fairly new to C, so I was wondering what would be the fastest way to get a char pointer pointing and ending between 2 different char delimiters? For example: text text (text I need) I need a char * to "text I need" |
The End.