A)I implemented your suggestion, but I also get strings less than length of original string. How can I eliminate these? I thought the following would work, but I still get the dimminished strings....
Type: Posts; User: UCnLA
A)I implemented your suggestion, but I also get strings less than length of original string. How can I eliminate these? I thought the following would work, but I still get the dimminished strings....
Thanks. I used all your suggestions and the output is cleaner, but still includes partial words, single letters and words larger than string length. How can I clean this up. Also the change you...
/*
** PERMUTE.C - prints all permutations of an input string
**
** adapted from public domain demo by Jon Guthrie for J. Uslander (4/1/2008).
**
*/
#include <string.h>
#include ...
Actually it was missing the final bracket from main(). It compiles ok now, but there is a runtime error. It asks the user for an input string, but also prints the error message as follows:
...
and line 81....
78 int charcmp(char *a, char *b)
79 {
80 return(*a - *b);
81 }
What follows is the error message after compiling using mingw code::blocks.
Everything looks in order but this.
Thanks for your help.
UC
C:\Users\UC\Downloads\New2C\permute2[1].c||In function...
Thanks for everyone's help here.
1)I allocated memory as suggested (yet I was learned on FAQ that malloc is the prefered method to use), and 2) I am now left with an compiler error regarding the...
I followed your advice, but I still have problems compiling.
Can I use strlen(string) as the length argument parameter for fgets??
What else might be the problem here.
thanks. UC
#include...
I've been working on the 2nd Beginners (Help-Free)Programming Challenge of this very same site, and could use some help completing. I have adapted a snippet (by jon guthrie) for a program to...
I have been reading thru the FAQ and looking at snippets and source code, but am somewhat confused how main() works. It seems that in several places that this function somehow contains the name of a...
Kudos to who(m)ever wrote the FAQ.
I am learning so much going thru these pages!!
My question is regarding what is the best learning approach.
Am I learning well enough by reading and learning...
Code is as follows:
#include <stdlib.h> /* Program to count the total # of lines in a file and print result */
#include <stdio.h>
int line_count=0; /* variable for total lines in a...