thanks dude. This website has a good example who wants to learn about it, should check it: Link
Type: Posts; User: BoneXXX
thanks dude. This website has a good example who wants to learn about it, should check it: Link
thanks, do you know what could I use to get first 3 characters of a string?
Could you give me a example code to get first 3 letters of a string by using strlen().Thanks.
Such as like this, no details just a small example.
int strlen ( char * string ) ;
printf...
Thanks for the replies. I will try to give more information about the question that I am going to solve. The user will specify the number of vertices. For example: 7.
In the numerical order of...
Hi all,
I need some advise about the program that I am going to write. I'll try to explain it briefly. There is going to be an array, such as ;
[ 0 1 2 3 4 5 6]
and each array element going...
I put some printf statements around
printf("Enter an unit name but not more than 100 characters:\n");
scanf("%s",buffer);
n=(char*)malloc(strlen(buffer)+1);
strcpy(n,buffer);
printf("n:%s...
Thanks for the reply but in your codes nothing goes into the function. In my codes everything is fine until "delete_it(n,the_list);", when it comes to this point I get a segmentation fault.
It is fixed. I have another question now. When I want to delete a name from the list I get a segmentation fault. At least could you help me on this?
calling the function:
printf("Enter an...
it didn't work:( Can it be related to my main program.
printf("Enter a name:\n");
scanf("%s",buffer);
n=(char*)malloc(strlen(buffer));
strcpy(n,buffer);
delete_it(n,the_list);
I tried it with && (strcmp(before->next->name, new_node->name) == 0) but I will try your suggestion and let you know. Thanks.
I sorted out now, it compiles in the right alphabetic order but it can take the same input more than once. Is there any idea?
void insert_in_order(char *n, node_ptr list)
{
node_ptr...
but whit the while loop I wanted to compare the previous and the current nodes find the right place. Such as 1 2 4 5 - 3 is going to be inserted between 2 and 4. I was trying to do this.
Thanks for the reply. The compiling problem is fixed.
Unfortunately it didn't sorted in the way that I wanted which is in an alphabetic way.
My input was : a b z c
the output : c z b a
Thanks for the replies.At this point I need bit more effective. Am I on the right right track, if I am not can you put me on the right track?
I am getting
list.c:59: warning: passing arg 2...
I want to print out a sorted string linked list but my codes sort in the order of entry.
such as :
Input : e a g c
Outout : e a g c
How can I convert my codes to insert the inputs in...
Thanks a lot, it is a simple thing but when you don't have much experience, it is a complex problem. I was trying to figure out for hours. I appreciate it, it compiles fine now.
warning: implicit declaration of function `malloc'
warning: implicit declaration of function `strlen'
warning: implicit declaration of function `strcpy'
I am getting these messages when I...
Just for an exercise. it can be 10.
#ifndef _1_H
#define _1_H
struct car
{
int car_km;
I don't know how to get int car_km, char *car_color from struct car?
printf("%s", current->car_brand);
printf("%d", current->numberOfcars);
printf("%d", ?????); /* car km*/...
Okay, I have one more question; did that code create me this node?Thanks
Node
Car Brand
Number of cars which are the same brand
car km,color
Null
Could you check my work, please? I wanted to create an empty list, is this right?
This is the header stuff:
#ifndef _1_H
#define _1_H
struct car
{
Do you have any good example program? I don't have any experience with 2D arrays.
Thanks for the reply.
http://cboard.cprogramming.com/showthread.php?t=22444&highlight=multilist
I am looking for a multilist tutorial. Does any one know a good multilist tutorial? Thanks in advance.
Thanks for the replies.