Search:

Type: Posts; User: apacz

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    6
    Views
    3,861

    cin - reading empty line;

    Hi,
    I would like to read an empty line. I would like an effect which is similar to:


    cout << "Press enter to continue."
    getchar();

    But I would like to do it with cin stream. Is it possible?...
  2. Replies
    7
    Views
    1,625

    Thanks for replies. I'm coding a program which...

    Thanks for replies. I'm coding a program which simulates some kind of a process evaluation. And I would like to introduce "time" in this program, so it would give an illusion that some process really...
  3. Replies
    7
    Views
    1,625

    Makeing a delay in program.

    Hello,
    I would like to make a delay in a program but I want to use something OS and API independent - I mean, is there any function in standard library of C++ to make something like that ? Or if...
  4. Replies
    3
    Views
    1,041

    Thanks for replies. In this time I will use...

    Thanks for replies. In this time I will use template specialization.
    Best regards.
  5. Replies
    3
    Views
    1,041

    How to compare types ?

    Hi!
    I have sucha situation:

    class a
    {
    vector<int> v1;
    vector<some_type> v2;
    vector<some_type2> v3;
    public:
    template <class T> void f(T a)
  6. Replies
    8
    Views
    3,524

    while calling it (a program). I know how works...

    while calling it (a program). I know how works argc, argv. I just asked if it's neat to use it when I'm coding in C++ - because I rather connect that mechanism with pure C. Probably "communicate"...
  7. Replies
    8
    Views
    3,524

    argc, **argv in C++.

    Hello,
    I'm coding a program which I want to communicate with user while calling it. And is it neat to use int main(int argc, char *argv[]) in C++? Or maybe there are other, better technics in C++ to...
  8. Thank you for help.

    Thank you for help.
  9. Binary representation of a number, binary operators.

    Hi,
    I have to deal with a binary representation of a number, starting with most significant bit. The problem is that I don't have enough memory to keep the whole binary representation so I can't...
  10. Replies
    12
    Views
    2,665

    Thank you very much :).

    Thank you very much :).
  11. Replies
    12
    Views
    2,665

    because I have sucha code: #include ...

    because I have sucha code:

    #include <stdio.h>

    int main()
    {
    int s;
    scanf("%d\n", &s);
    getchar();
    return 0;
  12. Replies
    12
    Views
    2,665

    scanf() question.

    Before my program quits, I would like a user to press enter before the program ends. I want to do something similiar to simple:
    getchar();
    but with using scanf();
    Is there anyway of doing it like...
  13. Replies
    8
    Views
    1,582

    Ok, thx. So there is nothing bad in fclose(ptr)...

    Ok, thx. So there is nothing bad in fclose(ptr) when ptr == stdin ? Do you know maybe something about my mem leak problem?
    Regards,
    apacz.
  14. Replies
    8
    Views
    1,582

    Well, my intension was to get a data from a file...

    Well, my intension was to get a data from a file if it was gave while running program ("./a.out filename" situation) or to get a data from keyboard. So if there was no filename while running a...
  15. Replies
    8
    Views
    1,582

    My program should be run like this: ./a.out...

    My program should be run like this: ./a.out file_name
    and now - if someone did just "./a.out" then he can input data from keyboard. But if argc > 1 (so he put file name) we try to open this file for...
  16. Replies
    8
    Views
    1,582

    fclose and mem leack problem.

    Hello.
    I have such a code:

    FILE *plik;
    if(argc > 1)
    plik = fopen(argv[1], "r");
    if(argc <= 1 || plik == NULL)
    {
    plik = stdin;
    ...
  17. Replies
    3
    Views
    1,714

    Thanks. But there is no way to make this overload...

    Thanks. But there is no way to make this overload look like: bool operator<(const bignum& rhs) ? Because your overload takes two arguments - what's the real difference between those two versions ?...
  18. Replies
    3
    Views
    1,714

    Problem with overloading an operator.

    Hello,
    I have to overload "<" and ">" operators. So I do:

    bool bignum::operator<(const bignum& a)
    {
    // here is some code comparing *this and a.
    }
    now I want to use operator "<" to...
  19. Reading a string from the input which length isn't known.

    Hi,
    I need to read a string from the input but I don't know the length of it. So I would like to read for example first 100 chars, then next 100 chars and so on, till '\n'. I though about using...
  20. Thanks.

    Thanks.
  21. Thanks for replies. Salem: I have a question to...

    Thanks for replies.
    Salem: I have a question to the middle part of this operator (Q.push(p(make_pair(i,j), make_pair(i,j))), 0). .push() doesn't return anything so this '0' is a real value of...
  22. Hi, I don't think that it obfuscates the code...

    Hi,
    I don't think that it obfuscates the code but it makes it shorter.
    Regards,
    apacz
  23. condition ? instruction1 : instruction2 ; question.

    Hello,
    I have such a line:

    mapa[i][j] == '1' ? dist[i][j] = 0, Q.push(p(make_pair(i,j), make_pair(i,j))) : dist[i][j] = 0x7fffffff ;
    but it doesn't really work, I got an error:

    Can anyone...
  24. Replies
    7
    Views
    4,178

    Hello, I have next version of my program ;) : ...

    Hello,
    I have next version of my program ;) :

    #include <stdio.h>
    #include <string.h>
    #include <unistd.h>
    #include <stdlib.h>
    #include <sys/wait.h>

    #define MAXLEN 1000 /* Maksymalna...
  25. Replies
    7
    Views
    4,178

    I've also added wait() in parents' code: ...

    I've also added wait() in parents' code:


    #include <stdio.h>
    #include <string.h>
    #include <unistd.h>
    #include <stdlib.h>
    #include <sys/wait.h>

    #define MAXLEN 1000 /* Maksymalna dlugosc...
Results 1 to 25 of 76
Page 1 of 4 1 2 3 4