Search:

Type: Posts; User: antonis

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    35
    Views
    3,082

    Sorry people, I have tryed to change the scanf's...

    Sorry people, I have tryed to change the scanf's with fgets, but I didn't make it! I gave up. I suppose the programm will stay as it is.
  2. Replies
    7
    Views
    971

    I am a newbie too, but except the thing cwr...

    I am a newbie too, but except the thing cwr wrote, I cant see of something that could become simpler, or in less lines. I think it's OK.
  3. Replies
    35
    Views
    3,082

    Thanks DavT, I will try to replace the scanf's...

    Thanks DavT, I will try to replace the scanf's with fgets as soon as I go back home today. I will report when I have done this.
  4. read i for k=0; knext...

    read i
    for k=0; k<=i ++i
    k=k->next
    --------------------
    then insert the i after k
    you have just to adjust the ->s. Its like this
    k->next->prev=i
    i->next=k->next
    k->next=i
    i->prev=k
  5. Replies
    35
    Views
    3,082

    I have uploaded to my homepage: homepage...

    I have uploaded to my homepage:
    homepage
    Here you have to download the files from Project 2! nvi383.c is my code the others are for compilation (memory.c&memory.h about using MALLOC instead of...
  6. Replies
    35
    Views
    3,082

    No I used flush too, but the 2 prompts are still...

    No I used flush too, but the 2 prompts are still there. I had to send it before 1 hour, so I put a comment explaining what doesn't work. It's minor to the whole programm but I have spent so many...
  7. Replies
    35
    Views
    3,082

    for you maybe! But I won't play this game any...

    for you maybe! But I won't play this game any longer.
  8. Replies
    35
    Views
    3,082

    Of course I don't think I'm brilliant, I am...

    Of course I don't think I'm brilliant, I am absolutely a newbie.
    The teacher first tells you the right thing and then corrects your mistakes.
    I don't have anything against laughing but against...
  9. Replies
    35
    Views
    3,082

    I have: else if (l=='b'){ ...

    I have:


    else if (l=='b'){
    /*Dialog to insert a new line before current line.*/
    printf("Insert the new line:\nTEEDI>");
    fflush(stdout);
    ...
  10. Replies
    35
    Views
    3,082

    Yes you helped.... But why doesn't it stay at...

    Yes you helped....
    But why doesn't it stay at the prompt and goes directly to the function? Should I change ti to scnaf again?
    AA
  11. Replies
    35
    Views
    3,082

    @cwr: This code is OK but here: else if...

    @cwr: This code is OK but here:
    else if (l=='b'){
    /*Dialog to insert a new line before current line.*/
    printf("Insert the new line:\nTEEDI>");
    ...
  12. Replies
    35
    Views
    3,082

    else if (l=='b'){ /*Dialog to...

    else if (l=='b'){
    /*Dialog to insert a new line before current line.*/
    printf("Insert the new line:\nTEEDI>");
    fgets(newline, MAXLINE,stdin);
    ...
  13. Replies
    35
    Views
    3,082

    Thanks barnzey it now worked. Just one more...

    Thanks barnzey it now worked. Just one more question stdin means it reads from the keyboard????
  14. Replies
    35
    Views
    3,082

    @durban: what do the std::cin. mean with...

    @durban: what do the std::cin. mean with std::cin.getline(line, 256);it doesnt get compiled. When using just getline(line, 256); I get segmentation immidiatelly when I run the prog.
  15. Replies
    35
    Views
    3,082

    @Quantum:Your code gives this while compiling ...

    @Quantum:Your code gives this while compiling

    /home/plutonas/tmp/ccADhe1V.o(.text+0x2a): In function `main':
    : warning: the `gets' function is dangerous and should not be used.

    and for fgets,...
  16. Replies
    35
    Views
    3,082

    I use the assigment operator at printf because...

    I use the assigment operator at printf because else I get segmentation. But actually I dont need to read and write a line(so printf is not actually needed), I can do this by another way: ...
  17. Replies
    35
    Views
    3,082

    #include main() { char *line;...

    #include <stdio.h>
    main()
    {
    char *line;
    scanf("%s",&line);

    /*NOW USE THE TEXT LINE WHILE CALLING A FUNCTION*/
    printf("%s",&line);

    Here,
  18. Replies
    35
    Views
    3,082

    Simple question (for you not for me!)

    Hi
    I want to make a programm that takes a text line from the keyboard, and then I want to use the line as a parameter in a function.
    Here is my code:


    #include <stdio.h>
    main()
    {
    char line;...
  19. Replies
    2
    Views
    3,666

    void InsertAfter(struct list *buffer, char...

    void InsertAfter(struct list *buffer, char *newline)
    {
    //if currentpos is last line: I have to add....
    struct node *makeNode(char *newline);
    struct node...
  20. Replies
    2
    Views
    3,666

    Insert node in a linked list.

    Hi everybody!
    I asked yesterday something about my project: TOPIC
    and now that I have almost finished I have problems with the last function that inserts a new line after the current. Here there...
  21. Replies
    6
    Views
    2,392

    Salem! I don't know how to thank you. :) Really...

    Salem! I don't know how to thank you. :)
    Really thanks a lot.
    It works, I have been a lot further with my project(thanks to your help I could make 2 more functions: InsertLine and DeleteLine also...
  22. Replies
    6
    Views
    2,392

    These are my structs: struct node { ...

    These are my structs:


    struct node {
    char *line;
    struct node *prev;
    struct node *next;
    };

    struct list {
  23. Replies
    6
    Views
    2,392

    I did it but with prev instead of next as it...

    I did it but with prev instead of next as it starts from the last line, and I could not make the *next pointer while reading the file. I think it should work but : segmentation fault! I HATE...
  24. Replies
    6
    Views
    2,392

    FPUTS-struct node loop.

    I have to make a programm that among others outputs a text stored in a struct node (line by line), in a file. I use fputs.
    Here is the function PrintFile that prints the file:



    void...
  25. Replies
    4
    Views
    1,154

    I have problems to allocate the data.... I think...

    I have problems to allocate the data....
    I think ist very complicated for a newby like me.
    So, I want to use a struct node, where very line is a node,
    and a struct list.
    here the function again...
Results 1 to 25 of 32
Page 1 of 2 1 2