deceptikon 1,790 Code Sniper Team Colleague Featured Poster

and everybody is up to speed with what happened yesterday, and what is planned to happen today.

I suppose it would depend on how quickly things happen and the size of the team. If you organize tasks and milestones with the kind of granularity that would produce significant changes from day to day as opposed to week to week, then daily meetings are justified. In my experience that's not productive, but I also work in a fairly small company where questions can be addressed by walking over to someone and having a chat or updates are along the lines of leaning over and saying "hey, what are you working on right now?". ;)

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I do occasionally, but it's more productive working in the office and when I can talk to my coworkers in person.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

"Homework" in this sense is any small exercise that is intended for learning, practice, or personal gain.

  • Learning exercises don't teach you much if you're told how to do it or given the solution.
  • Practice exercises don't let you practice when someone else does it.
  • Since the point of a competition is for you to solve the problem, being told the solution is tantamount to cheating.

If you've been working on this for two days then you should have no problem describing the many ways you've tried to solve it and how those solutions weren't sufficient. If you can't do that then your claim of working on it for two days rings untrue.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I just press enter after it for enter marks n it's terminated

It's not terminated, it's waiting for valid input. You told scanf() that you're going to type a float, and then you don't type a float. What were you expecting to happen?

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Thanks! problem solved!

I expect that you'll be back in relatively short order with the same error and a different cause? Not that I'm attacking Gonbe for pointing out the problem this time, but you still need to learn how to trace access violations.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Nevertheless I think communication in software engineering is sometimes pure chaos because of the constant change in requirements and the constant arrival of new technical problems which are never encountered before. I like programming but not so much in a professional setting with the constant ad-hoc communication, lack of time, and where everything is floating in your collegeau's heads instead of in documents.

Is this speculation, an opinion based on hearsay, or do you really have some sort of experience with the environment? In my years working as a developer and consultant, I can't say that I've seen any companies that could be described as "pure chaos". In fact, the changes and deadlines are often handled quite well.

I'm also starting to wonder what you mean by "ad-hoc communication" and how this could possibly be considered a bad thing.

But I thought agile methods where on the rise.

Claiming to be agile is on the rise. Actually being agile to the point where a fan of the methodologies would agree, not so much.

Well if i had my own software company, everybody would have his own office and communication would be going with chat as much as possible.

In my experience, it's faster and more effective to discuss things face to face, or at least over the telephone. Chat is relatively slow if you're in the same office space, and it's difficult to convey complex ideas without hand waving and a whiteboard. Often there's …

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

this is also running only single time

It will read and display two students. If you made no changes to the code then you're doing something wrong with the input at runtime. There's also the possibility that your Turbo C compiler is doing something stupid, but that's very unlikely with such simple code.

Please give exact details about how you're running the program. What do you type, what output do you see, etc...

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I'm getting error "Segmentation fault(core dumped)" if I append numbers to list2.

Obviously you have an invalid pointer somewhere. I'd wager that either you're not properly checking for NULL before dereferencing the pointer, or you neglected to set a link to NULL when creating the list. Either way the segmentation fault is telling you that you're accessing memory that isn't owned by the process.

To fix these errors you trace through the code in a debugger until it happens. From there you can see which pointer is invalid, and can then backtack to the point where the pointer is set (or should be set) to find the source.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

yeah tht was mine mistake scanf("%d", &a[i].age,&a[i].marks); in this line
it will be
scanf("%d", &a[i].age);
but still it is taking only two value

That was a mistake, but it's a benign mistake. If there are more variable arguments than format specifiers, the extra arguments will be ignored. So both of those calls to scanf() will only read the age. This is well defined behavior, though the code will still be confusing to readers because of the mismatch.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

"Not running" is not helpful. But because you've stumbled on a very common problem of mixing formatting and unformatted input, it's easy to guess what the real problem is. Replace this line:

gets(a[i].name);

With this:

while (!gets(a[i].name) || !a[i].name[0])
    ;

The problem is that gets() will stop reading when it encounters a newline character, but scanf() will tend to leave whitespace (which includes a newline character) in the stream. Thus if you call scanf() followed by gets(), there's a good chance that the gets() call will appear to be skipped because it's terminating successfully on the newline character.

By looping over the gets() call as long as it either fails or results in an empty string, you avoid that particular error. The above loop won't work very well if gets() fails due to a stream error, but that's a very rare occurrence anyway.

Your code also has a bunch of bad practices, but I'll let others point them out and explain why they're bad as repeating the same thing over and over for years takes its toll. But here's the fixed code (without error handling, to keep it from getting too bulky), just for review sake:

#include <stdio.h>

#define MAX_NAME     20
#define MAX_STUDENTS 2

struct student {
    char name[MAX_NAME];
    int age;
    float marks;
} a[MAX_STUDENTS];

int main(void)
{
    int i;

    for (i = 0; i < MAX_STUDENTS; i++) {
        printf("Enter the name of student: ");
        fflush(stdout);

        while (!fgets(a[i].name, sizeof a[i].name, stdin) || a[i].name[0] == '\n') …
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I think the work envoirments are a bit to much centered around verbal and direct communication for me.

Good luck finding any lucrative career that isn't. Rather than running away, you should be working to improve your communication skills.

in agile teams
And the open office layout

Want to know a secret? Full agile isn't as popular as agile folks would like you to believe, and related practices such as pair programming and open offices are actually pretty rare. Most companies that use agile will design a watered down subset of it to suit their needs without forcing them to adopt a completely (pardon the term) "hippy" style of software development.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Ignore the above it would be an answer so it's evil and totally stupid of me to post.

No offense, but this statement makes you seem childish and bitter. Surely you can tell the difference between explaining how const works and posting a complete working program for an obvious homework question, right?

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Post your code for B please. That's the closest you have, and it'll probably be easier to fix a minor bug than direct you toward the appropriate algorithm.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

i need codes for the program

Daniweb is not a homework service. You do the work, and we help you with specific questions and direct you toward how to fix things when you get stuck. Last I checked, "help" doesn't mean "do it for you".

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

If I choose database of a hospital, I provide data, let's say I predefined it, and then a user can access those files and records through my database. Or he can input some of his own. That is all that I need to provide as a programmer of this project, yes?

Yea, pretty much.

Lastly, is hospital database better or the store database?

As far as you're concerned for this project database is a database. Whether it's for a hospital or a store, the actual database stuff will be so similar as to be the same.

And can you provide me a link with an example of a database so that i can understand how I should begin my project?

At this level it's just a text file. For example, you could have each line of the file represent a record and each piece of the record be separated with a pipe character. For example:

Name|Age|Height|Weight
John Doe|45|6.0|210
Jane Doe|43|5.6|140
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I check the value range of double and long double with vs2010, but it gives me the same value.

Yes, long double is pretty much just a synonym for double to Microsoft's C++ compiler. In fact, Microsoft even recommends against using long double forms of the standard library.

could you please tell me how to use the long double format in vs2010.

The sensible answer is to use a compiler that supports extended precision floating point. You could write conversions to IEEE 80-bit or 128-bit from IEEE 64-bit (the format of double in Visual Studio), but I'd recommend against that if you can avoid it. You could also look for a library that supports extended precision floating point like GMP.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

So we still know the fundamentals but nothing too advanced for decent oops.

The humorous thing is that in a few years you'll probably see "decent OOP" as unmaintainable shit and revert back to the fundamentals. The process of learning, especially with C++, seems to revolve around overcompensation. You learn a new feature and abuse it until it seems like a bad feature, then overcompensate by cutting out any use of the feature.

Eventually, the better programmers take an attitude of moderation with a strong tendency toward simplicity. So I imagine what you're calling "decent OOP" is something that experienced programmers will be using with moderation.

-is it a decent project proposal?

Yes. I'd recommend the store option, or more specifically a point of sale system, but interface details are largely irrelevant at this point.

-what is a databse basically providing?

Any persisted data. For a hospital it would be medical records like personal information, medical history, visit history, and procedure details.

-Should it be predefined (already names and histories and the patient's health notes are fed into it or are to be input)

It doesn't matter, though some seeded data would be a good idea for development purposes.

-how big the databse should be?

As big as it needs to be? :P I suspect you'll just be using a simple file for the database, and the size of the file is largely irrelevant given that this isn't a database …

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

but in normal linked list we input the values from user for example like scanf("%d",t->data);

You can do that here too, I just chose not to because it would complicate the code and obscure the actual logic of the list.

but here everything is static

I think you mean "hardcoded". static has very specific meanings in C, so I'd recommend not using that word for something that isn't one of those.

so here we have to allocate everything before entering data???

You always have to allocate space before entering data. While an array is used here, there's nothing stopping you from using a dynamic array that's resized as new nodes are needed. Remember, my example is just an example, and a very simple one at that. Use your imagination for other variations of the cursor list concept.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

this line of code is used for memory allocation right???

The memory is already allocated (all nodes are stored in the global freelist array). Those lines of code are extracting an unused node and attaching it to the cursor list. Note that this is a very simple way of using indexes as links, it's not really well suited for a serious implementation. But it's adequate for expanding one's mind as to the possibilities beyond pointers.

the above specified lines of code i tried it in a paper work but here the 1st link should go to 2 right

The important thing to keep in mind is that the order of nodes in freelist is completely independent of the values of each node's next member. You could set it up like this and it'll work just fine:

#include <stdio.h>

struct node {
    int data;
    int next;
};

int main(void)
{
    struct node freelist[100];
    int i;

    freelist[56].data = 0;
    freelist[56].next = 11;
    freelist[11].data = 1;
    freelist[11].next = 34;
    freelist[34].data = 2;
    freelist[34].next = 72;
    freelist[72].data = 3;
    freelist[72].next = -1;

    for (i = 56; i >= 0; i = freelist[i].next)
        printf("%d\n", freelist[i].data);

    return 0;
}

It doesn't matter what the value of next is as long as it refers to the logical next node in the list.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

please help

Please don't bump your threads unless you have new information. It's rude in general because it presumes that we haven't been following your thread since its inception, and suggests an attitude of arrogance and entitlement (ie. "my thread is more important than all of the others"). By bumping you can also sabotage yourself. Some people will choose not to help you for no reason other than the bump.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

ok i know linked list to implement in structures and arrays but cursor is quite difficult for me to understand.i dont know how an array can have next link ????

Okay, it sounds like your concept of links is focused too much on pointers. A link is nothing more than some way to get to the next node. The most common way to implement that is directly with a pointer, but you can also do it with an array index. Look, same concept, different method of implementation:

#include <stdio.h>

struct node {
    int data;
    int next;
};

static struct node freelist[100];
static int next = 0;

int main(void)
{
    int i;

    for (i = 0; i < 10; ++i) {
        freelist[next].data = i;
        freelist[next].next = next++ - 1;
    }

    for (i = next - 1; i >= 0; i = freelist[i].next)
        printf("%d\n", freelist[i].data);

    return 0;
}

That's all there is to it.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

while I do that, how do i add games to my site for now?

:facepalm:

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

hmm tats wat iam asking a proper link for it

Pardon my confusion, but is it really too difficult to reason about with nothing more than an understanding of linked lists and a functioning brain? You're going to encounter situations where there's not a web page to teach you everything about a subject, and your only recourse is to figure it out through experimentation.

Now, I could certainly do a google search for you and post some links here, but I think it might be better to force you to be inventive while things are still relatively easy. If you don't have practice in real problem solving (and not just regurgitating what you've read in a book or on a website), you'll be massively overwhelmed when the tasks become truly complex.

WaltP commented: But if I google it, how will I know which link will be understandable??? 8-P +14
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Um...what?

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

The simplest cursor linked list would be an array of nodes where the "next" pointer is actually just an index to another element in the array. The linked list concept is the same, all that changes is how you link to other nodes.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

in these lines, s is transformed from a character to a character array that contains the string "this is a test" ... this is whats happening here right?

s is a pointer to a character. Passing the address of s to foo() means that foo() can allocate memory to s. Then s is treated as if it were an array. Please don't confuse arrays and pointers, they're not the same thing.

so a pointer declared as static will have the same effect when fed to a realloc() as in case of a malloc()...?

What does static have to do with anything?

but what if the pointer was originally pointing to something else?? do we do a {free() + pointer=NULL} on it? is it a good way? or we reset it??

if reset; then is reset ==
1. keeping an original copy of the pointer,
2. assigning that original to the pointer at a later time

is this the default way to reset?

I don't understand the question.

free() makes a dangling pointer, that gives need to assign NULL to it... ?

You don't need to assign NULL to the pointer, just don't use it until you've pointed it back to something that you own.

thus, by definition, shouldn't realloc serve as an improved version of free() ??

No, because by definition, realloc() could allocate memory that itself needs to be freed if you pass a size of 0. …

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

The most basic solution is to wrap the code in pre tags to preserve the formatting. But be careful with C++, because you'll need to remember to escape certain characters like angle brackets and the & operators, otherwise they'll be stripped when the browser can't interpret them as HTML. It's annoying looking at naively posted code and seeing #include with the actual header missing. ;)

You could also wrap the code in HTML code tags. I'm not sure off the top of my head if that will fix the stripping problem or not though, it's something to test.

If you need highlighting as well then there are a number of syntax highlighting options out there such as Google Code Prettify or SyntaxHighlighter.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

hoe does getline allocate memory ?

Consider this example:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void foo(char **p, size_t bytes)
{
    *p = malloc(bytes);
}

int main(void)
{
    char *s;

    foo(&s, 15);
    strcpy(s, "this is a test");
    puts(s);
    free(s);

    return 0;
}

foo() is passed a pointer to a pointer, it then dereferences that pointer and allocates memory to the pointed to pointer. This is more or less the same functionally as if you allocated the memory to s directly in main(). That's what getline() does, except it does so in a way that guarantees (barring allocation errors) the string will be big enough to hold an entire line.

is this whats meant by pointer resetting??

It means to change where the pointer points to.

why do that to make a pointer null? if pointer is to be made null, free() + pointer=NULL seems good enough.. ?

I think you misunderstood that paragraph. realloc() doesn't set the pointer to NULL, it can't. That part of the documentation is describing realloc()'s unfortunate overloaded behavior. Here's what it means with examples:

realloc(NULL, 5) == malloc(5)
realloc(p, 0)    == free(p)

And because realloc() returns a pointer to void, in the "free" case it simply returns a null pointer. However, the documentation you linked to is outdated. Please bear with me for a moment because I'm going to get into minutia of the C standard.

The C89 standard explicitly states that realloc(p, 0) behaves …

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

thats a neat way to print ;) gonna do that myself when possible :)

Don't do it because it's neat. Do it when it makes the code easier to read.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Can you please explain me this asm code snippet.

It looks straightforward to me. Arguments are pushed onto the stack, _strncpy() is called, and the stack is adjusted to "remove" the arguments. Which parts are confusing you?

My reall question is how allocated memory on stack that doesn't poped at the end of the functions is written on c++ language.

In C++ all memory pushed onto the stack in or by the function will be popped. Attempts to use a pointer to any local variables or parameters after the function returns invokes undefined behavior because you're referencing memory that's highly likely to be reused almost immediately for other things.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I've heard cross-fit is an absolute killer indeed.

It's funny you chose to use the word "killer". Crossfit is notorious for causing injuries. ;)

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Maybe you need more coffee? ;)

Heheh. Sadly, coffee has no apparent effect on me. That's why I can drink it like water.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Arrays cannot be compared with the == operator. You really have no choice but to loop over the elements and compare them onesie twosie:

int equal = 1; /* Equal until proven otherwise */
int i;

for (i = 0; i < 5; ++i) {
    if (output_1[i] != output_2[i]) {
        equal = 0;
        break; /* No need to continue the comparison */
    }
}

if (equal)
    puts("are equal");
else
    puts("not equal");

This is assuming the arrays are of equal length, of course.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

So then to instantiate a class with the default constructor, omit parentheses, but with parameters, use parens (along with params)?

Intuitive, isn't it? :D

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Also I'm surprised that you are content with just two good shows when the entire season looks like a jackpot. :P

These days I find myself having trouble keeping up with everything, so the shows I look for first are adaptations of manga I enjoyed. Those two are fantastic manga, and it would be difficult to mess them up unless they deviate completely from the original story.

I'm still waiting for W Juliet and Hana Kimi[1] though. One day, one day... ;D

Oh, and I've been reading Baby Steps recently. It's an excellent tennis manga that's more realistic so far than any of the others I've seen. I'm not sure how well an anime adaptation would work given the theory explanations, but the action would be better. ;)

[1] Hana Kimi had a live action adaptation, but it was total crap compared to the manga. The live action stuff tends to have a certain style that doesn't appeal to me.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

why are you regretting now ?

Because you latched onto it and that apparently stopped your progress in writing a program until I clarified that it's okay to use qsort(). :P

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

can you please write how to do it using intrptr_t?

Don't get confused with stuff like intptr_t. All you're doing is casting the value stored by a pointer (not the value stored by the pointed to object) into an integer type so that bitwise operators can be used on it.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Honestly, if I were you I would be more worried about your atrocious spelling and grammar than employers giving two shits about any cheating scandals when you were in school.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I am planning write a push_back interface for the Dynamic Array(as in the std::vector in C++).

I actually included that functionality at first, where there was both a size and capacity member in the darray. But there was an intended usage problem. With an automatically growing dynamic array you basically have to take full control over the size and disallow direct element access. Everything has to go through the add/remove interface, otherwise the actual size and reported size may not match.

The intention of the darray is to simplify resizing rather than give up full control over the array, so I cut out the size and left the capacity. Now the library is basically little more than a C array where the size can change at runtime. So rather than a true vector (a la C++), it's a slightly more flexible array.

I think adding vector-like behavior to darray would be best implemented as a wrapper around the library, and possibly even as an opaque type so that direct access to the darray isn't allowed:

struct vector {
    darray base;
    size_t size;
};

extern void push_back(vector *p, void *item);
extern void insert(vector *p, size_t pos, void *item);
extern void erase(vector *p, size_t pos);
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

will this work?? i think it should work as long as bigDaddy is big enough :D

You have the basic idea, though don't forget to populate bigDaddy with the first partial line or the full line if buf is big enough:

char buf[BUFSIZ];

bigDaddy[0] = '\0'; /* Empty bigDaddy for strcat */

while (fgets(buf, sizeof buf, stdin)) {
    strcat(bigDaddy, buf); /* Always append the buffer */

    if (buf[strlen(buf) - 1] == '\n')
        break; /* Only break when a full line is read */
}

As AD mentioned, if bigDaddy is already big enough then just read directly into it. The partial line stuff with fgets() is mostly for when you're building a string dynamically and don't know how long the line might be (or similar situations).

getline() is a c++ function not useful in C programs.

A fact which is totally irrelevant to this thread because the getline() function being discussed is a C function provided by GCC. See the link in the first thread that says "read here"? It would be a good idea to read there before making assumptions. ;)

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

When I said the issue is academic, it means you can always rely on qsort() being reasonably efficient in practice. I'm regretting even mentioning the name being a misnomer now. :(

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

When you do this:

sqrt(123);

It's functionally identical to this:

double temp = 123;
sqrt(temp);

The integer value is assigned to a double parameter, which is perfectly legal as I described above.

I don't have my hardcopy of K&R handy right now, so I can't fact check what it says, but the cast isn't required, and sqrt() is well behaved when given integer values. In C++ you'll get ambiguity errors due to overloading of sqrt(), but in C it's all good.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

qsort() doesn't mean it is qsort() ?

qsort() is misnamed because it implies quicksort. qsort() could be implemented as heapsort, or mergesort, or bubble sort, or any other sorting algorithm.

will you please xplain this line ?

qsort() is highly likely to be O(nlogn), but there's no hard guarantee in the standard. That's really all it means.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

but problem is i wana do this in nlogn by using quick sort or merge sort. and for quick making the code, i wana use the qsort() function already defined in the C.

Just because it's called qsort() doesn't mean that it's implemented as quicksort. There's no requirement in the C standard that qsort() meet or exceed any time complexity minimum, so a truly horrid implementation could use bubblesort (or even bogosort).

Of course, any reasonable implementation will use an O(nlogn) algorithm, so the lack of a guarantee is mostly just academic. But it's good to be aware of it.

but problem is that i want to sort the array of structures on the basis of its one member which is y in this case.

That's not a problem at all. The comparison function qsort() expects takes two pointers to const void as arguments. All you need to do is cast to the structure type and compare the members:

int compare(const void *a, const void *b)
{
    struct my_struct *pa = a;
    struct my_struct *pb = b;

    if (pa->y == pb->y)
        return 0;

    return pa->y < pb->y ? -1 : +1;
}
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

doesn't sqrt() take argument of type "double" by default??

No, it takes an argument of type double absolutely.

the book says sqrt() will return non sensical values if given argument of type int?

Which book is "the book"? If you pass an int to sqrt(), it will be promoted to double. The two types are compatible because double can exactly represent any value in the range of int. In this case I'd say either your book is simply wrong, or you're misinterpreting what it says.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

fgets() is bad only if you don't understand how it works. I'd wager that the label of "unreliable" in the page you linked to has to do with how fgets() handles partial lines. If the line in the stream is longer than the buffer provided to fgets() can hold, no newline is stored at the end. This way the programmer can check for a newline and make another call to get the rest of the line (or the next partial line)

This is correct in the presence of extra long lines:

char buf[BUFSIZ];

while (fgets(buf, sizeof buf, stdin)) {
    fputs(buf, stdout);

    /* Did we read a partial line? */
    if (buf[strlen(buf) - 1] == '\n')
        break; /* No, all done */
}

also i think the default getline() isnt in C , is it??

getline() isn't a standard function, it's a library extension under GCC. Therefore, getline() is also bad because it's not guaranteed to be supported. ;)

whats a '**'? why is it used??

It's a pointer to a pointer. The reason that getline() here uses it is because the pointer you pass may be reset to point to memory allocated within getline(). It's really just the same reason why you'd pass a pointer to an int if you want to modify the value of the int in a function:

void foo(int *p)
{
    *p = 123;
}

int main(void)
{
    int x = 0;

    foo(&x);
    printf("%d\n", x); /* Prints 123 */ …
somjit{} commented: this is going to help a looot of people..! +2
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Hit the Esc key to cancel the code insertion.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Dual core is the general term for processors with two independent CPUs. Core 2 Duo is Intel's brand name for one of their dual core processors. It's akin to the difference between a compact car and a Honda Civic.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

means what specific use github has ?

Github is a host for version control repositories.