Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. bterribi

    forking a grandchild process in C

    *in both of my code examples
  2. bterribi

    forking a grandchild process in C

    What would the conditional expression be for another if statement? From my understanding, if pid > 0, then pid is considered a parent process and will always execute the else statement both my code expamples.
  3. bterribi

    forking a grandchild process in C

    #include <stdio.h> #include <sys/types.h> #include <unistd.h> int main (int argvc, char *argv[]) { pid_t pid; int arg1 = atoi(argv[1]); pid = fork(); if (pid == 0) { printf("I am child\n"); printf("my pid is: %d\n", getpid()); printf("my...
  4. bterribi

    friend class

    Thanks! I modified my code based on your suggestions and it now compiles :) #include <iostream> using namespace std; class door { public: door(){lock=true;} void setlock(bool l); private: bool lock; }; void door::setlock(bool l) { lock=l...
  5. bterribi

    friend class

    >Is that all in one file? (.h or .cpp?) one cpp file >In your person class you use a house* pointer before defining the house class. I've tried a forward declaration of house before person and that reduced my errors to the following: In member function `void person::opendoor(house*)'...
  6. bterribi

    friend class

    /* Dev-C++ 4.9.9.2 Will someone be so kind as to explain why I get these errors at compile time: line 30: variable or field 'opendoor' declared void line 30: 'int person::opendoor' is not a static member of 'class person' line 30: 'house' was not declared in this scope line 30: 'h' was not...
  7. bterribi

    for_each &amp; copy algorithm

    //Thanks...remove_copy_if got the job done! bool isLetter(char c) { return !((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')); } string removePunctuation (string s) { string t; remove_copy_if(s.begin(), s.end(), back_inserter(t), isAlphabetic); return t; }
  8. bterribi

    for_each &amp; copy algorithm

    /* Hello, I'm attempting to write the function body for removePunctuation w/o loops. I've been playing around w/ the for_each algorithm to remove punctuation from a string s (which seems to be working fine), then copy the results into a new string t. For example, convert "a*^^bc__" to "abc"...

Part and Inventory Search

Back
Top