15,551 Topics
![]() | |
hi, i have the following problem:: i want to read a string from the stdin. The string may contain white spaces so {i think} the scanf family of functions is out of the question... I think the most appropriate function for this case is fgets {if i am wrong please … ![]() | |
I have a palindrome program.Is there a way to ensure user input terminated in a string by a punctuation mark (e.g. ‘!’, ‘.’, or ‘?’.) in an array? And how do i get the program to exclude commas? | |
[B][I][COLOR="Green"]please guys i need help on the above. write a finction in c to find the number of times that a given word (i.e a short string) occurs in a sentence.[/COLOR][/I][/B] | |
[CODE]#include<stdio.h> int main() { for(;0;) printf("Hello"); return(0); }[/CODE] This code should not give any output, but it is printing Hello once. I'm using TC++ 3.0. Is something wrong with the compiler? | |
I am working on a similar program and am getting an error that states 'strcmp' cannot convert parameter 1 from 'const char' to 'const char *'. ( I haven't gotten to the swap yet.) Do you know how I should fix this? [code] #include <stdio.h> #include <string.h> #include <ctype.h> #define … | |
in the book "advanced programming in the unix environment" the authors give the following function to "deamonize" a process [CODE=c] void daemonize(const char *cmd) { int i, fd0, fd1, fd2; pid_t pid; struct rlimit rl; struct sigaction sa; /* * Clear file creation mask. */ umask(0); /* * Get maximum … | |
[B]i have a problem in a program i am making. In my program i need to call a function again and again until the string entered in it is not correct. Initially i was using gets() but it wasn't accepting the string.[/B] [B]i cahnged it to scanf(), so it is … | |
Hello all, I need to write a code that compress and uncompresses thegiven file in c.Well i know there are many algorithms available ,one of the famous algorithms is Huffman's algorithm.But how do i implement the algorithm ?.I googled a lot but couldn't able to find ?.Is there any simple … | |
Can anyone help me with the creation of this kind of tree?I tried something but it didn't work.:-/ thank you | |
Hello there! I.m trying to write a function that should delete specified entry from .dat file. But it just ADDS TWO MORE NEW ENTRIES- the same as the last entry in that file. I'm trying to read all entries into temporary file and then write them all back, except the … | |
Hi, The system under my program is using MySql version 4.0.18. I want to have a documentation for using [COLOR="Red"]MySql Transactions API[/COLOR] from my C program. Could you give some link? thank you. | |
Also argument 2 makes integer from a pointer with a cast. One argument is a struct declared in an included library. It's declared like: [code]struct pixelst *lzwArr; lzwArr = (struct pixelst *) malloc(pixels); // pixels is an int[/code] the second argument is an unsigned int 2D array. It's used in … | |
Hello. I'm new to Daniweb and am trying to create a program in C that will compile sales tax after the user inputs a purchase amount. Am I doing it right? I would appreciate any suggestions and feedback. Also, I am unable to see my output using the Run function … | |
hi i have this pieceof code and im not sure as to what it is im doing wrong but i cant get this piece of code rnning any suggestions? [code=c] #include <stdio.h> #include <math.h> int grade input (double *a[i],double *i) { scanf("%l",&*a[i]); return 0; } int main (void) { double … | |
Write a program to find the number of times that a given word(i.e. a short string) occurs in the sentence(i.e. in a sentence!). Read data from the standard input. the first line is a single word, which is followed by general text on the second line. read both up to … | |
| |
hi, i have a doubt in vector strings what are these vector strings. and if this is a vector how to find the dimention of these vector or what is the dimention of this vector. and how to do vector string things in c language. | |
how to write an optimized version of the following factorial recursion function in C along with some explanation please ?? [code=language] int factorial(int num) { if (num == 0) return 1; else return num * factorial(num - 1); } [/code] Looking forward for your help! Thanks, Nanda Kishor [B][url]http://www.c4swimmers.net[/url][/B] | |
i want to know what are the differences of different header and their uses or meaning when they will use in a program.i hope there is someone who can define their purpose. God blessed us. | |
hi i am a newbies in c program. I'm just 1st year college from the course of computer technology.i just want to know what was the purpose of flowcharting in a program.does it express an idea or a plan to make a program?. then what was the connection of these.?thaks | |
hi, i was wondering if it is possible to send a struct through sockets... thanks in advance, nicolas | |
what is the source code for this [code] ABCDEFGFEDCBA ABCDEF FEDCBA ABCDE EDCBA ABCD DCBA ABC CBA AB BA A A [/code] | |
I have a problem that deals with reading a random access file and creating an index file, which is a file to hold the binary tree of the random access file. I have the index file created with SSN (key), relative address of the SSN in the random access file, … | |
hello does anyone knows the meaning of the error undefined reference to main. i'm getting the error when trying to compile a file without a main function with -Wall option | |
i have a program which outputs a [COLOR="Green"].prt [/COLOR]file for printing barcode. But i want to send the file directly to the printer port LPT1 for printing instead of having [COLOR="Green"].prt[/COLOR] file please any body suggest a solution. [COLOR="Red"]Regards Prashant[/COLOR] | |
Hello All, I am trying to write a C program that reads a text file and output unique words sorted alphabetically using /usr/bin/sort. All non-alphabetic characters serves as delimiters and are discarded. I am having a problem just parsing the text file into words, getting SEG FAULTS. dbx gives error: … | |
I have been trying to write a code for Conways Game of life, the thing is I need to generate a matrix of char filled with the elements * or o(o marks a dead cell,*marks an alive one). The Rules: For a cell that is alive: Each cell with one … | |
Hey everyone, I'm working on function that will take in a char array, prompt the user to input a string, and then return that string to the function. Below is what I've been working on and yes, I know it is not the right syntax, but I'm hoping someone could … | |
I know there is a way to represent binary, octal and hex values in C, but how do you do it? Like, say, if i wanted to specify a hex number i would do, unsigned char i = 0xFF; or unsigned char i = 0x32; What if i wanted to … | |
I need to write a function that will take a char* string and populate a char* array with elements of the original string. The elements of the original string are whitespace-delimited. I have seen a function do this, but it is somewhat complex (deals with a lot more factors and … | |
Can u help me in my assignment in making a calendar program using turbo c. I have made a few functions but im now stuck. What will I do with this? User is asked to input year and month, then the out put will be the year and the Calendar … | |
[B][I][COLOR="Red"]good day![/COLOR][/I][/B] we were given a project. it is a program for an airline company. in this program, [B]the user can view vacant seats in the airplane[/B] then [B]he can make a reservation in any of those seats [/B]or [B]cancel a reservation[/B] he had made. he can also[B] view the … | |
I am designing an ftp client prompt in C (unix environment). At this point, I have an infinite loop with an fprintf of the prompt on stdout and an fgets for reading user input. I need help with the structure of my program. How do I implement this? I have … | |
Dear all; I want to join three strings become one string. For example char date1 = "03"; char date2 = "06"; char date3 = "2007"; char new string; what I need is new string like: new string =[COLOR="Red"]03-06-2007.txt[/COLOR] I will use new string as input file name that will be … | |
i got an issue of creating a QUEUE of integers in a circular array using C to insert, remove, display, show CAN ANYBODY HELP ME OUT HERE | |
hey guys, im having a hard time making this switch function catch letters and return the error message. [CODE]int main() { int choice; do { /* THE DISPLAY MENU*/ printf("================================================\n\n"); printf("Welcome to Walther's Tic Tac Toe Game.\n\n"); printf("what would you like to do?\n\n"); printf("1 Play Tic Tac Toe\n\n"); printf("2 Quit\n\n"); … | |
i want to find make a program for insertion in AVL binary tree therefore i want to find balance factor of a node by subtracting depth of right child from dephth of left child how will i find this depth. i am using array representetion of the tree. | |
I am having problems trying to figure out exactly what is going wrong with my code. I am trying to create a factorial program using an array. I have tried, unsuccessfully, various ways to make it work but I can not figure it out. Any assistance would be appreciated. [code=c] … | |
Dear all; I have problem in reading data file in C. I have data like this: 00:00:00 R- 0.0654 345 +19 00:01:00 R+ 1.5678 324 +19 00:02:00 2.3456 315 +19 00:03:00 R- 1.2352 324 +19 ........................ next until 1440 lines What i want is only the data in third column, … | |
does eny1 nos how 2 convert 16 bit to 8 bit if so plz tell me, i need a c program for it. thanx | |
I am writing client and server programs for a simple FTP. I am allowed to use chdir, getcwd and getenv. What would be a correct procedure to expand a user provided path correctly using these functions, assuming of course the user supplied path is stored in a c-string? Thank you. | |
I have to use a recursive backtracking search to solve the classic "bucket" problem. ie. You have two buckets, one holds 5L, the other 3L. Find a way to get 4L into the 5L bucket, while only being able to fill/empty either bucket, or to pour one of them into … | |
like the title i wanna know how to output a B-tree like that: ****************A ************B******C ********D******E*******F the struct of B-tree is: typedef struct node { datatype data; struct node *lchild, *rchild; } BTnode,*BTREE "*" means escape thanks | |
Hi everyone. I am a very new in this forum!! I create a little code in c to generate a time series!! Is a file .out, and I can´t open it in an Spreadsheet, opens automatically on Word Processor, even when I try to open from the Spreadsheet [QUOTE] 1 … | |
I'm a newbie teaching myself C, can anyone show me how to write a code that generates the next license plate number when you input one containing 6 characters 3 letters and 3 numbers, and asks the user if they want to continue or quit. Thank you | |
Hey, I've written a tic tac toe program. Computer makes some random moves, but i want it to be smarter and make some intellegent moves. any idea how to approach it? here's the code i've written. Although it's not that high-level, it's working fine. [CODE]#include<stdio.h> #define BOARDSIZE 9 #define USER … | |
Hi people! I´m working in a code with a friend! Both employ Linux Platforms, but he works in Suse, and I´m working in Kubuntu. Both distributions suppose to work with the GNU/Linux libraries. We work the code on his machine with Suse. And runs perfectly well! But in my Kubuntu´s … | |
Hello, could anyone please help me with this. I have a hardware connected to my PC via serial port. This hardware is sending me data (in HEX format). Now i would like this data save to a .txt file. Please help me. Here is my code so far...if anybody is … | |
[code=C] #include <stdlib.h> #include <stdio.h> #include <string.h> #include <math.h> int toAnyBase(int n, int toBase); // from base 10 (2nd) int toBaseTen(char array[256], int fromBase); // from any base (1st) int fromAnyToAny(char input[],int fromBase,int toBase); int main() { char input[10]; int fromBase=0; int toBase=0; int answer=0; int answer2=0; printf("Enter number :"); … |
The End.