Search:

Type: Posts; User: bradleyd

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    11
    Views
    1,515

    I got it to work doing this, not sure if this is...

    I got it to work doing this, not sure if this is the best way or not?

    for (int i = 0; i < phrase.size(); i++) {
    found = phrase.at(i).find("ssh",0);
    if (found != string::npos) {
    ...
  2. Replies
    11
    Views
    1,515

    This is what I have so far. #include ...

    This is what I have so far.
    #include <iostream>
    #include <fstream>
    #include <vector>
    #include <string>


    using namespace std;

    int main(int argc, char** argv)
  3. Replies
    11
    Views
    1,515

    I guess I should have worded it better. The...

    I guess I should have worded it better. The string will always start with ssh, whether it is just ssh or ssh me@192.168.0.1. So in crude regexp format:
    ^ssh*
    thanks again
  4. Replies
    11
    Views
    1,515

    I tried using find but it only returns ssh. So if...

    I tried using find but it only returns ssh. So if there were 10 occurences of of the word "ssh", they are not all just ssh. Some are ssh me@192.168.0.1. I am trying to return all strings that contain...
  5. Replies
    11
    Views
    1,515

    the vector is a vector of strings. I used this to...

    the vector is a vector of strings. I used this to populate it:

    while (getline(infile, line))
    {
    file.push_back (line);
    }


    Thanks for the response.
  6. Replies
    11
    Views
    1,515

    search text from file

    Hello,
    Is there a way to search a vector and return all occurrences of a string. I have read a text file into a vector and want to search throught the vector. For example I am searching the vector ...
  7. Replies
    9
    Views
    1,521

    I will give it a try and post back. Thanks again.

    I will give it a try and post back. Thanks again.
  8. Replies
    9
    Views
    1,521

    Will the data still come out in descending order?...

    Will the data still come out in descending order? I gues I am unsure what you mean.
    Thanks for the reply.
  9. Replies
    9
    Views
    1,521

    Here is the osrt method I am using. I created an...

    Here is the osrt method I am using. I created an array of int's to try it out for now.
    I am passing it month[] which is an array of int's(1-12) and the rainfall amounts the user has entered, plus...
  10. Replies
    9
    Views
    1,521

    this is a class assignment and we have not gotten...

    this is a class assignment and we have not gotten to struct's yet.
  11. Replies
    9
    Views
    1,521

    thanks for the reply. Unfortunately I can't use...

    thanks for the reply. Unfortunately I can't use struct's. I have to do this with just arrays, or vector's.
  12. Replies
    9
    Views
    1,521

    sorting arrays

    hello everyone,

    I was wondering if there is way to sort two different arrays of different data types without struct's.
    For example lets say you have an array of doubles that represent rainfall...
  13. Replies
    7
    Views
    30,385

    ok that makes sense. Thanks to everyone. Take...

    ok that makes sense. Thanks to everyone.
    Take Care.
  14. Replies
    7
    Views
    30,385

    no your changes worked perfect. I was just a...

    no your changes worked perfect. I was just a little confused. If I call get_l(); in main, it does return current user. But when I try to call it from sprintf, I get the error. I just wanted to know...
  15. Replies
    7
    Views
    30,385

    that was it, I had it return(buff), but it gave...

    that was it, I had it return(buff), but it gave me an error about returning local variable. So I switched it to what I submitted. When I put get_l(); in main it would return current user. I am a...
  16. Replies
    7
    Views
    30,385

    invalid use of void expression

    Hello everyone,

    I am trying to use sprintf, but keep getting error: invalid use of void expression

    sprintf(s,"%s",get_l());The function get_l looks like:
    void get_l()
    {
    FILE *data;
    char...
  17. Thread: process id

    by bradleyd
    Replies
    6
    Views
    1,263

    I get it, thanks again Salem Take care

    I get it,
    thanks again Salem
    Take care
  18. Thread: process id

    by bradleyd
    Replies
    6
    Views
    1,263

    so basically I can read the contents of...

    so basically I can read the contents of /var/run/pidn.pid and that will give me the pid of the process I just started. I have tried other things like gedit in place of pppd call and it gives the...
  19. Thread: process id

    by bradleyd
    Replies
    6
    Views
    1,263

    ok, do you know how I can get the pid when I...

    ok, do you know how I can get the pid when I execute pppd daemon from within the code?
    Thanks for the response.
  20. Thread: process id

    by bradleyd
    Replies
    6
    Views
    1,263

    process id

    Hello everyone,
    I am stuck with fork(), pid, popen(). I am trying to execute a command, capture it's pid so that when I choose to stop the command I can use kill(). What I have works as far as...
  21. Replies
    5
    Views
    1,196

    the executable and files will be installed on...

    the executable and files will be installed on other machines. I will not be the one installing them, so there is no telling where they will install them. I was trying to piece together a way so no...
  22. Replies
    5
    Views
    1,196

    thanks MacGyver and zacs7. fopen does look in...

    thanks MacGyver and zacs7. fopen does look in cwd. The only problem I was having is the executable may not be in the same folder as the file it is opening to read.
  23. Replies
    5
    Views
    1,196

    fopen function call

    hello everyone,
    I can't figure out the correct way to do this. I have a function that gets the current working directory. I am using fopen to read a file, but want to use CWD function to return cwd:...
  24. Replies
    8
    Views
    2,221

    ok that makes sense, thanks MacGyver. Pointers...

    ok that makes sense, thanks MacGyver.
    Pointers seem to be my weak point in C.
  25. Replies
    8
    Views
    2,221

    Thanks that worked, I kinda foggy on char...

    Thanks that worked, I kinda foggy on char *GetHome vs. char GetHome. If you want to return any string from a function do you always have use a pointer in declaring the function?
    when you want to...
Results 1 to 25 of 45
Page 1 of 2 1 2