15,551 Topics

Member Avatar for
Member Avatar for n.aggel

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 …

Member Avatar for iamthwee
1
324
Member Avatar for xeto

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?

Member Avatar for WaltP
0
338
Member Avatar for tofwono

[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]

Member Avatar for WaltP
0
252
Member Avatar for Jishnu

[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?

Member Avatar for WaltP
0
98
Member Avatar for mosullivan

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 …

Member Avatar for danzona
0
80
Member Avatar for n.aggel

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 …

Member Avatar for Salem
0
143
Member Avatar for rati

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

Member Avatar for Salem
0
735
Member Avatar for gauthamnaggg

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 …

Member Avatar for Jishnu
0
204
Member Avatar for phoenixlsk

Can anyone help me with the creation of this kind of tree?I tried something but it didn't work.:-/ thank you

Member Avatar for Narue
0
113
Member Avatar for Wiizl

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 …

Member Avatar for Wiizl
0
292
Member Avatar for asilter

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.

Member Avatar for Ancient Dragon
0
82
Member Avatar for RexxX

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 …

Member Avatar for Aia
0
3K
Member Avatar for Gia

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 …

Member Avatar for bitRAKE
0
101
Member Avatar for kadeemdagreat

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 …

Member Avatar for WaltP
0
219
Member Avatar for kiel19

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 …

Member Avatar for WaltP
0
743
Member Avatar for lubi_iit
Member Avatar for WaltP
0
35
Member Avatar for aaabhish

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.

Member Avatar for Ancient Dragon
0
113
Member Avatar for kalki
Member Avatar for c4swimmers_net

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]

Member Avatar for Salem
0
125
Member Avatar for carlarolan

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.

Member Avatar for carlarolan
0
113
Member Avatar for carlarolan

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

Member Avatar for carlarolan
0
104
Member Avatar for n.aggel

hi, i was wondering if it is possible to send a struct through sockets... thanks in advance, nicolas

Member Avatar for n.aggel
0
265
Member Avatar for Kishor.hegde

what is the source code for this [code] ABCDEFGFEDCBA ABCDEF FEDCBA ABCDE EDCBA ABCD DCBA ABC CBA AB BA A A [/code]

Member Avatar for carlarolan
0
150
Member Avatar for jbstin

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

Member Avatar for WaltP
0
121
Member Avatar for emilio

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

Member Avatar for emilio
0
91
Member Avatar for pdwivedi

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]

Member Avatar for Salem
0
109
Member Avatar for GrazBurya

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

Member Avatar for Salem
0
158
Member Avatar for holy_boy

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 …

Member Avatar for WaltP
0
273
Member Avatar for Barefootsanders

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 …

Member Avatar for Salem
0
210
Member Avatar for desijays

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 …

Member Avatar for Salem
0
80
Member Avatar for Ratte

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 …

Member Avatar for Aia
0
99
Member Avatar for janxxx

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 …

Member Avatar for Salem
-3
207
Member Avatar for mae ann

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

Member Avatar for jbennet
0
295
Member Avatar for Ratte

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 …

Member Avatar for Ratte
0
132
Member Avatar for marzuki

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 …

Member Avatar for Narue
0
81
Member Avatar for delacruise

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

0
60
Member Avatar for jimwalther

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"); …

Member Avatar for chandrasekharn
0
105
Member Avatar for gauravmishra

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.

Member Avatar for Duoas
0
92
Member Avatar for DennisB

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

Member Avatar for Narue
0
8K
Member Avatar for marzuki

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

Member Avatar for marzuki
0
134
Member Avatar for badbloodyeyez

does eny1 nos how 2 convert 16 bit to 8 bit if so plz tell me, i need a c program for it. thanx

Member Avatar for Nick Evan
0
661
Member Avatar for Ratte

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.

Member Avatar for Duoas
0
138
Member Avatar for tehloki

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 …

Member Avatar for Salem
0
80
Member Avatar for leeqiang

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

Member Avatar for Narue
0
171
Member Avatar for Paulville

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 …

Member Avatar for Ancient Dragon
0
102
Member Avatar for banditt_77

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

Member Avatar for Salem
0
162
Member Avatar for megan-smith

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 …

Member Avatar for WaltP
0
174
Member Avatar for Paulville

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 …

Member Avatar for Paulville
0
746
Member Avatar for Pačo

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 …

Member Avatar for Pačo
0
121
Member Avatar for imran_s

[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 :"); …

Member Avatar for Aia
0
4K

The End.