Search:

Type: Posts; User: augur

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    3,605

    Greetings, First of all: use code tags: ...

    Greetings,

    First of all: use code tags:

    void main(){
    struct mystruct *pdemo; /* You forgot the '*', typo? */
    /* Also, at this point the compiler does not know about 'alloc_mystruct'...
  2. Replies
    10
    Views
    3,653

    Greetings, Get DJGPP, it's free and Allegro...

    Greetings,

    Get DJGPP, it's free and Allegro supports it.
  3. Replies
    1
    Views
    1,333

    Greetings, Try:...

    Greetings,

    Try: System.Environment.GetCommandLineArgs()
  4. Replies
    3
    Views
    1,126

    Greetings Nope. Only the functions you...

    Greetings

    Nope. Only the functions you actually use in the program are actually linked to the finall .exe.
  5. Thread: Sockets

    by augur
    Replies
    10
    Views
    2,512

    Greetings, I don't know what's wrong with the...

    Greetings,

    I don't know what's wrong with the time functions, it works perfectly here. I'm using MS VC7 compiler, but the code is pretty standard, i think!

    Are you sending every keypress on the...
  6. Thread: Sockets

    by augur
    Replies
    10
    Views
    2,512

    Greetings, For the IP part try: ...

    Greetings,

    For the IP part try:

    inet_ntoa(client.sin_addr);
    'inet_ntoa' takes the structure as a parameter not the '.s_addr' member of the structure.

    Here's an example for the date/time...
  7. Replies
    28
    Views
    3,231

    Greetings, c-strings faster than std::string?...

    Greetings,

    c-strings faster than std::string? I doub't it, std::strings will often be as fast as c-strings and in some circumstances even faster. They become less efficient when frequent...
  8. Replies
    15
    Views
    3,436

    Greetings, In that case I'm sorry, but what I...

    Greetings,

    In that case I'm sorry, but what I got from 7stud's post was not that <string.h> isn't there, but if you are coding C++ you should be using the Cname header instead, i.e: <cstring> and...
  9. Replies
    15
    Views
    3,436

    Greetings, The thing is, if you are using...

    Greetings,

    The thing is, if you are using <iostream> you should use <cstring> if you are using the old C string routines. <string.h> is only in the standard for the same reason <iostream.h> is:...
  10. Replies
    8
    Views
    3,611

    Greetings, C++ is all about classes! Besides,...

    Greetings,

    C++ is all about classes! Besides, structs are classes in C++, the only difference (apperently) is that in struct's the members default to public where in classes it defaults to private.
  11. Replies
    6
    Views
    1,254

    Greetings, But i bet you can make your own...

    Greetings,

    But i bet you can make your own functions.
    Anyway, here's an example on how to find a string inside another:


    #include <iostream> // This is the standard header. 'iostream.h'...
  12. Replies
    2
    Views
    950

    One piece of advice...

    Greetings,

    Don't mix C++ standard headers with the non-standard/deprecated headers. "iostream.h" is deprecated, the standard header is "iostream", and please do use the code tags, it makes it much...
  13. Replies
    12
    Views
    2,499

    Greetings, There is no full-proof method of...

    Greetings,

    There is no full-proof method of protecting the access to your PC, if one has phisicall access to it, one can do anything.
    BIOS is no good, anyone can break that.
    One way of making it...
  14. Replies
    6
    Views
    6,880

    Greetings, std::string also has the '='...

    Greetings,

    std::string also has the '=' operator defined that you can use like:


    #include <iostream>
    #include <string>

    int main
    {
  15. Replies
    21
    Views
    4,063

    Greetings, Elaborating on thenrkst's ideia,...

    Greetings,

    Elaborating on thenrkst's ideia, and if speed is not that important you can avoid bitwise operators alltogether:

    #include <iostream>

    typedef unsigned char byte;
    typedef unsigned...
  16. Thread: I/O Stream

    by augur
    Replies
    6
    Views
    1,288

    Greetings, Actually std::ifstream...

    Greetings,

    Actually
    std::ifstream ifs("a:/data/gradefile.txt");works just fine in windows.
  17. Thread: vector indexing

    by augur
    Replies
    2
    Views
    1,323

    One thing, to convert a vector to a string:...

    One thing, to convert a vector<char> to a string:

    std::string myString(myVector.begin(), myVector.end());
    // or on an empty string:
    myString.insert(myString.begin(), myVector.begin(),...
  18. Replies
    6
    Views
    13,804

    Re: ....cout too

    #include <iostream> // std::cout, std::endl
    #include <iomanip> // std::setprecision

    int main()
    {
    double d = 1234.56789;
    std::cout << d << std::endl; // output: 1234.57;
    std::cout...
  19. Replies
    9
    Views
    2,833

    Hi, Dynamic arrays have to be allocated with...

    Hi,

    Dynamic arrays have to be allocated with the 'new' operator or the 'malloc' function.


    ifstream infile("text.txt");

    infile >> numrecords_str;

    numrecords = atoi(numrecords_str);
  20. Replies
    8
    Views
    1,329

    Well, there was an error with my 'to_int'...

    Well, there was an error with my 'to_int' function, as Codeplug pointed out. Try this:


    int to_int(const string& val)
    {
    int number;
    istringstream is(val);
    is >> number;
    ...
  21. Replies
    8
    Views
    1,329

    You are absolutely right about the...

    You are absolutely right about the 'istringstream', my bad!
    And I was wrong, again, about 'atoi', it is 'itoa' that is not part of the standart.
  22. Thread: words count

    by augur
    Replies
    2
    Views
    1,905

    Greetings, I'm no guru but this should do it:...

    Greetings,

    I'm no guru but this should do it:


    #include <iostream>
    #include <string>
    #include <sstream>

    int main()
  23. Replies
    8
    Views
    1,329

    Greetings, That is because 'atoi' is expecting...

    Greetings,

    That is because 'atoi' is expecting a C string.
    There are at least a couple of ways you could do this, first by using the 'c_str()' member of std::string and pass that to 'atoi' like...
  24. Replies
    5
    Views
    1,483

    Greetings, '30 + ob' does not work, in this...

    Greetings,

    '30 + ob' does not work, in this case, because the compiler is looking for an '+' operator wich takes an left operand of type int and a right operand of type X, and there isn't one. ...
  25. Replies
    8
    Views
    1,251

    Well, if the only thing being converted are...

    Well, if the only thing being converted are int's, then no, templates aren't necessary at all, but still is good to know what your options are, don't you think?
    One should aim at making code...
Results 1 to 25 of 27
Page 1 of 2 1 2