Search:

Type: Posts; User: hilarius

Page 1 of 3 1 2 3

Search: Search took 0.00 seconds.

  1. Replies
    4
    Views
    1,293

    Thanks, laserlight, I followed C_ntua's advice...

    Thanks, laserlight, I followed C_ntua's
    advice to dive into C++ and it's fun.
  2. Replies
    4
    Views
    1,293

    oop: inheritance

    I have a question about this class:



    class Word {
    public:
    Word();
    ...
    private:
    string lemma;
  3. Replies
    17
    Views
    2,113

    Thank you very much for your opinions! I'll...

    Thank you very much for your opinions! I'll stick with C. and if I'm stuck, I know a good place to ask for some help. ;)
  4. Replies
    17
    Views
    2,113

    I'm sorry, I don't want to start a flame war, but...

    I'm sorry, I don't want to start a flame war, but I'm trying to figure out if C is actually suited for my (hobby)-project, which has to do with the syntax of a natural language. It has to look up...
  5. Replies
    17
    Views
    2,113

    Is C suited for big applications?

    Well, maybe it's a stupid question, but I don't know the answer and I hope to see one here.
  6. Replies
    9
    Views
    3,479

    What happens if i enter a letter instead of an...

    What happens if i enter a letter instead of an integer number? The program doesn't complain, it just takes the wrong integer.



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

    int main(){
    int a;...
  7. Replies
    9
    Views
    3,479

    safe integer input

    I read that the scanf function is not safe. I made an attempt for a getInt(), but I'm not happy about it. I have to give two arguments: the max value and the max length of the number (I mean the max...
  8. Gödel, Escher, Bach: an Eternal Golden Braid

    Anyone who read this book? If so, did you like it?
  9. Replies
    13
    Views
    1,163

    Look again at this for-loop: for(int j=0;...

    Look again at this for-loop:


    for(int j=0; j<0; j--){

    How many times will the loop be executed?
    Think about how you could rewrite this to make it work.
  10. Replies
    6
    Views
    1,261

    That's true: it should be: char p[] = {'a',...

    That's true: it should be:


    char p[] = {'a', 'b', 'c', 'd', 'e', '\0'};


    Sorry for the inconvenience, but I adapted the original post.
  11. Replies
    6
    Views
    1,261

    char *p = "abcde"; char p[] = "abcde"; In...

    char *p = "abcde";
    char p[] = "abcde";


    In the first statement the address of the first element of the string literal "abcde" is assigned to p. This string literal is constant.

    The second...
  12. Replies
    3
    Views
    3,484

    Which skills you don't have? Opening a file?...

    Which skills you don't have? Opening a file? Reading a line? ....?
  13. Thread: fgets help

    by hilarius
    Replies
    5
    Views
    847

    And last but not least: end the main() with a ...

    And last but not least: end the main() with a


    return 0;
  14. Thread: fgets help

    by hilarius
    Replies
    5
    Views
    847

    You're welcome !

    You're welcome !
  15. Thread: fgets help

    by hilarius
    Replies
    5
    Views
    847

    the problem is in this line: line[count] =...

    the problem is in this line:



    line[count] = temp;


    You are assigning a string to a char array. You can't do this with the =-operator.
    You should # include <string.h> and use strcpy() to...
  16. Replies
    17
    Views
    1,987

    That's what I asked you to do. Now try to find...

    That's what I asked you to do. Now try to find out how to implement strcomp with pointers.
  17. Replies
    17
    Views
    1,987

    Laserlight, you are right: #include...

    Laserlight, you are right:



    #include <stdio.h>

    int main(void)
    {
    char a[6] = "hello";
    char * p = a;
  18. Replies
    17
    Views
    1,987

    There is a pointer passed: in my post above I...

    There is a pointer passed: in my post above I said that array names are equivalent with pointers. If you take str, it is seen as the address of the first element of the array.
  19. Replies
    17
    Views
    1,987

    Should I have said: "An array name is an...

    Should I have said: "An array name is an address?" Is this correct? In any case you can do pointer arithmetics with an array name (like *(a+1) in my example). This let me make the conclusion that an...
  20. Replies
    17
    Views
    1,987

    Another important fact to know is that if ...

    Another important fact to know is that if



    char a[6] = "hello";
    int i = 0;


    then these two statements are the same: a[i] and *(a + i)
  21. Replies
    17
    Views
    1,987

    A hint, but you should try to implement it...

    A hint, but you should try to implement it yourself:


    int strcomp(char *, char *);


    or even better:


    int strcomp(const char *, const char * );
  22. Replies
    17
    Views
    1,987

    You didn't 'make' any pointer but you're using a...

    You didn't 'make' any pointer but you're using a function that takes a pointer as an argument:

    size_t strlen ( const char * str );

    str is a pointer to char.
  23. Replies
    7
    Views
    861

    Aww... this thread is becoming like my...

    Aww... this thread is becoming like my nickname....;)
  24. Replies
    7
    Views
    861

    #include #include #include...

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

    int main(){
    int i;
    int j;
    int k;
    for(i = 0; i < 30000; i++)
  25. Replies
    4
    Views
    1,872

    Hello, it's better to post this question in the C...

    Hello, it's better to post this question in the C # subforum.
Results 1 to 25 of 60
Page 1 of 3 1 2 3