My function(copy_list) doesn't work.I can't figure out where is the problem.
Type: Posts; User: paranoidgnu
My function(copy_list) doesn't work.I can't figure out where is the problem.
Hi,
I want to write a copy_list function that creates a linked list(the function result) with new nodes that contain the same data as the linked list referenced by the single argument of copy_list...
Hi,
I want to create and display a binary search tree of integer keys.
But, I have problem with my inorder function.I simply want to display the resulting ordered list after each insertion by...
I'm trying to store all digits of a decimal number.I have decided to use modf for this purpose.My code segment is;
struct high_precision scan_high(int *j)
{
int i,a;
struct...
I have edited code,It works,but in some cases it gives segmentation fault.
#include <stdio.h>
#include <string.h>
void LongestCommonSubstring(const char *str1_in, const char *str2_in, char...
Hi, again a question from the book.
Question wants to find longest common prefix of two words
(e.g. global and glossary and longest common prefix of them glo)
I found an algorithm from wikipedia,...
Yes, but is it a bit complicated(Talking about your code)
For example I have to print output like this
printf("%d words, one letter = %d, two letter = %d, three letter = %d,\
four letter = %d,...
Now, it doesn't give error.But, I am not sure... Is that all?
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main(void)
{
char ch, string[100][100];
int i = 0,j, words = 0,...
@Salem ,
I want to create two dimensional array.How can I fix this error.
and bt gives
@Salem,
Latest code, nearly same as previous.
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main(void)
{
char ch, *string[100];
int i = 0,j, words = 0, one_word = 0,...
Thanks for your advices CommonTater.I will be more rigorous and careful.Anyway I have to be what you have said.You are right.
Now, gdb says;
I changed file name.But nothing changed..
@Commontater
You are right I have to be more rigorous, but it's just a question from a book.And I'm a beginner
text.dat is in same directory.But somehow it can't be read.
And also I added this to my code.
if(inp == NULL)
{
printf("text.dat cannot be opened");
return 1;
and it says just like you...
Hi,
I solved question but somehow it gives Segmentation fault...
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main(void)
{
char ch, *string[10];
int i = 0,j, words = 0,...
Hi,This time Almost, I solved question.But I have problem with counting lines.I can't figure out how to count lines with isspace.
the code is
#include <stdio.h>
#include <string.h>
#include...
not working:
working:
I have edited the code.It works well, but sometimes makes wrong sort.Compiler didn't give errors.But, I am not sure about code.
#include <stdio.h>
#include <string.h>
int get_min_range(const...
Name of the book is Problem Solving and Program Design in C.
What will you suggest.Will I start coding from beginning or can it be corrected.
It is described in an example(in book).Book gives a comparison(numeric to string) and says write the string selection sort function described in example.
I mean strcmp and strcpy from book's...
I installed Nemiver.When it calls select_sort funtion, it gives "Target received a signal: SIGSEGV, Segmentation fault"
And also compiler gives
#include <stdio.h>
#include <string.h>
int get_min_range(const char *list, int first,int last)
{
int i, j, min_pos;
for (i=first; i<=last; i++) {
min_pos = i;
for (j=first; j<=last;...
Thanks, I solved the problem.
#include <stdio.h>
#include <string.h>
int main(void)
{
int first, next,n, x;
char code[40], warehouse[20], qualifiers[20], product[20];
printf("Enter...
First of all, it does not give proper output.
İts output:
Warehouse: ALT
Product: 232S1
Qualifiers: 123
And I will look at strtok.But I guess the problem is in my if statements.
Hi,
Again a question from Koffman's book;
Question inputs a string and separate it into components.
For example;
Input :
ALT1203S14
Output:
Warehouse: ALT
Product: 1203
Qualifiers: S14
Thanks for your help
I think, we solved problem.
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define ROWS 25
#define COLS 25
void game_of_life(char o_arr[][COLS], char...