Search:

Type: Posts; User: tidemann

Search: Search took 0.01 seconds.

  1. Replies
    7
    Views
    1,720

    Thanks for all the help! It solved my errors :):)

    Thanks for all the help! It solved my errors :):)
  2. Replies
    7
    Views
    41,817

    Thanks a lot! Didn't know that it could be done...

    Thanks a lot! Didn't know that it could be done that simple.


    int d;
    for(d=0;d<strlen(cur);d++) {
    if(cur[d] == '&')
    printf("you wrote & sign\n");
    }
  3. Replies
    7
    Views
    41,817

    Find '&' character in char array?

    I need to loop through a char array containing a line read by fgets and check for the '&' character. I thought that fgetc or getc might do the trick, but it seems that they can only recieve a FILE...
  4. Replies
    7
    Views
    1,720

    Its only a snippet of a bigger system, pasting...

    Its only a snippet of a bigger system, pasting the whole code here would be too much... the code-snippet shouldnt compile... Thanks for the quick replies though. Strncpy did the trick! Thanks yxunomei
  5. Replies
    7
    Views
    1,720

    problems with strcpy

    I'm trying to copy a recieved char-array (cur) into cur2. Cur is a line read by fgets from user-input.

    I need a copy because cur is later divided into words, but cur2 should hold the entire line....
  6. Replies
    10
    Views
    5,483

    I solved the problem. I just had to re-write most...

    I solved the problem. I just had to re-write most of the copying... If anybodys interested I'll post the finished code at demand
  7. Replies
    10
    Views
    5,483

    Since ant is working with the concurrent object...

    Since ant is working with the concurrent object in the list I thought that it should be a char* since it will contain text . The fgets-example I posted above won't work if its declared as anything...
  8. Replies
    10
    Views
    5,483

    It should be a pointer to a struct(ure). I'm a...

    It should be a pointer to a struct(ure). I'm a newbie when it comes to creating single-lists in structures.

    First I thought that...


    if (fgets(ant,LENGTH ,file) == NULL) {
    ...
  9. Replies
    10
    Views
    5,483

    Ops! ant_line should be ant (edited now).. just a...

    Ops! ant_line should be ant (edited now).. just a typo. If I use malloc(strlen(ant->line) + 1) i get the following error:

    "request for member 'line' in something not a structure or union"
  10. Replies
    10
    Views
    5,483

    Ok! Thanks for the help. I've been working a...

    Ok! Thanks for the help. I've been working a couple of hours more now and figured some things out. A simplified code piece:


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

    #define MAX 2000
    #define...
  11. Replies
    10
    Views
    5,483

    print a text-file in linked list

    I need to get a C program to read a text-file (with aprox. 4 lines) to a linked list. and print it out.

    A simple method of doing this:


    char c[10];
    FILE *file;
    file = fopen(argv[1],...
Results 1 to 11 of 11