User Profile

Collapse

Profile Sidebar

Collapse
Rasputin
Rasputin
Last Activity: Oct 27 '07, 05:31 PM
Joined: Jun 5 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Rasputin
    replied to Borland C++ Builder - Using Resource DLLs
    in C
    I have never used the mult lang feature, but for example when I wanted to use OLE components in Builder I had to add the appropriate packages in the compiling options, for them to appear in the menu. Maybe this is something similar you need to investigate?


    Ras....
    See more | Go to post
    Last edited by Rasputin; Jul 28 '07, 08:03 AM. Reason: cleaned the quote

    Leave a comment:


  • Rasputin
    replied to random numbers..
    in C
    This is some pretty good answer. But sometimes I wonder if it's actually worth it to answer such posts and spend much more energy than the initial poster seems to have put.

    Ras....
    See more | Go to post

    Leave a comment:


  • Rasputin
    replied to random numbers..
    in C
    If you include the standard library there is the function random(someInte ger), that is going to return an integer from 0 to someInteger.

    I believe it's the second type of random function generator that ravenspoint posted (mathematical).

    Ras.
    See more | Go to post

    Leave a comment:


  • Rasputin
    replied to Deleting previous text in C++
    in C
    I must share this: I was TAUGHT AT SCHOOL to use goto in VB.

    At times some profs really have the skills to ruin you......
    See more | Go to post

    Leave a comment:


  • Rasputin
    replied to Read data from a file into array
    in C
    I understand the whole thing now: I use Borland SDK, and instead of doing "#include <vector>", I work with "#include "vector.h" and then the vectors I use are not actually the ones of the standard library... no "using namespace std;" needed, and last 2 posts confusions understood.

    And actually as I'm writing this I only understand now why I was having an unexpected behaviour doing certain specific...
    See more | Go to post

    Leave a comment:


  • Rasputin
    replied to Read data from a file into array
    in C
    Your comment makes sense, and I do take some blame.
    But it seemed to me that a page like http://www.cplusplus.com/reference/stl/vector/ , on top results in google for simple queries, would be a more concise and helpful information than going on from scratch in this one thread. Also, a simple search on vectors in this forum would pop up all the basics. I admit, this way is not the most courteous.

    As for the includes, it maybe...
    See more | Go to post
    Last edited by Rasputin; Jul 20 '07, 06:18 PM. Reason: misquote

    Leave a comment:


  • Rasputin
    replied to Functions And Methods In C++
    in C
    I use method as a synonym to member function.

    There's already a thread on this:
    http://www.thescripts.com/forum/thread519233.html

    Ras....
    See more | Go to post
    Last edited by Rasputin; Jul 20 '07, 08:12 AM. Reason: spelling

    Leave a comment:


  • Rasputin
    replied to Read data from a file into array
    in C
    [code=c]
    std::ifstream file; //declare an input stream
    vector<string> vData; // declare your vector as a container for strings
    string temp; //needed to push the data in the vector

    try{
    file.open (path); // replace "path" by your path, or declare and define the variable path
    }
    catch(...){
    //Do something
    }

    while(!file.eof ()){ // Read...
    See more | Go to post
    Last edited by Rasputin; Jul 20 '07, 06:38 AM. Reason: comments added

    Leave a comment:


  • Or more compact:

    [code=c]
    int CalculateAverag e (int integer_1, int integer_2, int integer_3, int integer_4, int integer_5)
    {
    return ( (integer_1 + integer_2 + integer_3 + integer_4 + integer_5) / 5);
    }
    [/code]

    and maybe CalculateAverag e would be better returning a float instead of int.


    Ras.
    See more | Go to post
    Last edited by Rasputin; Jul 19 '07, 06:48 AM. Reason: parentheses

    Leave a comment:


  • Rasputin
    replied to Read data from a file into array
    in C
    I suggest the use of vectors over arrays. use push_back() method to fill them.

    Ras.
    See more | Go to post

    Leave a comment:


  • Rasputin
    replied to Worms and Viruses
    A low-level solution could be to ask him to stop.
    A hardware solution could be to cut the wire of his keyboard.
    A software solution could be to use his own programs against him, to inhibit him.

    The point being made is that your question needs to be more detailed....
    See more | Go to post

    Leave a comment:


  • Rasputin
    replied to difference between c and cpp
    in C
    This is a late reply, but I've been out of town for last 2 weeks. Anyway, just to say it's certainly good some times to put some humour in replies, and I'm obviously not taking personal negative answers to that.


    Ras....
    See more | Go to post
    Last edited by Rasputin; Jul 16 '07, 05:35 AM. Reason: spelling

    Leave a comment:


  • Rasputin
    replied to difference between c and cpp
    in C
    Personally, I think the main difference between C and C++ is the '++'.

    Ras.
    See more | Go to post

    Leave a comment:


  • Rasputin
    replied to Stickies
    in C
    I really like this one:

    Maybe another Corto Maltese's books fan? But that would definitely deviate from the topic......
    See more | Go to post
    Last edited by Rasputin; Jun 28 '07, 09:34 AM. Reason: bracket missing

    Leave a comment:


  • Rasputin
    replied to Weird thing with push_back again..
    in C
    aren't you missing a method that would allow to do something like myv[0].getValue() ?

    or did you overload the << operator, returning a ostream?...
    See more | Go to post

    Leave a comment:


  • Rasputin
    started a topic Stickies
    in C

    Stickies

    Hello,

    with 4 stickies and 1 announcement, my humble opinion is that they get overpassed more often than they get read. I also think it's a bit annoying for regular members to have to face this amount of permanent posts everytime they get into the forum.

    More precisely, I would suggest:

    1. Creating a third forum under http://www.thescripts. com/forum/forum215.html, and call it Tutorials...
    See more | Go to post

  • Rasputin
    replied to vectors - push_back() method
    in C
    Thanks. And to finalize this dicussion, what are the options that replace:



    Ras....
    See more | Go to post

    Leave a comment:


  • Rasputin
    replied to vectors - push_back() method
    in C
    Thanks for your time.


    This is the learner's job!




    Well, in the help of my compiler I see that the declaration of strtok() is
    [code=cpp]
    char *strtok(char *s1, const char *s2)
    [/code]

    Furthermore, an example is given;
    [code=cpp]
    int main(void)
    {
    char input[16] = "abc,d";
    char *p;

    ...
    See more | Go to post

    Leave a comment:


  • Rasputin
    replied to vectors - push_back() method
    in C
    Thanks for taking the time to test and answer.

    Sure. I didn't even know this type of declaration was permitted. What's the applications?



    I tested your code on my compiler, and it did not produce the unexpected behaviour. It seems it's because of the nature of the modification you applied to temp.

    In my code I had something like:
    [code=cpp]
    vector<string> v;
    string...
    See more | Go to post

    Leave a comment:


  • Rasputin
    started a topic vectors - push_back() method
    in C

    vectors - push_back() method

    Hello,

    suppose I have a string temp that I want to push in a vector vec1, using:
    [code=cpp]
    vec1.pushback(t emp);
    [/code]

    I noticed that if I change the content of temp, it will change the content of vec1[lastItem], unless I push in another value after temp. Another variant to get vec1 immunized against changes in temp was to use
    [code=cpp]
    vec1.pushback(t emp.c_str());...
    See more | Go to post
No activity results to display
Show More
Working...