CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: loves_oi

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Re: Question related to count down semaphores

    3 processes run this task. When process A runs wait(), does process A blocked until both B and C run wait() and semaphore becomes zero ?
  2. Question related to count down semaphores

    Hi, i'm wondering the bahaviour of the following code fragment. Assume that, firstly process A will invoke wait(), then B, and then C.


    semaphore s=3;

    while(1)
    {

    s.wait();
  3. how to make wait some processes inside a process using semaphores?

    Hello, i need to write such a code that, three processes will run concurrently, namely all 3 of them should be at the same region at the same time.

    The task looks like something like that:
    Task...
  4. giving one line command that prints lots of lines - ostream?

    I'm using cout to print lots of lines. But i want to put together them in one variable etc. Then , i want to print it.
    I think i can do it with ostream but I cant do it . Is there anybody to give...
  5. class template Convert which can convert itself to any data type

    template<class T>
    class Convert
    {
    T data;
    public:
    Convert(const T& tData = T()) : data(tData)
    { }

    template<class C>
    bool IsEqualTo( const C& other ) const
  6. Replies
    2
    Views
    911

    is "try catch" stops running ???

    I have the below main .


    int main(void)
    {
    try{
    Product p1("makarna", "gida", 1,9 );
    Product p2("peynir", "gida", 3,4 );
    Product p3("peynir", "gida", 3,10 );
    Product p4("cif",...
  7. Replies
    2
    Views
    675

    Vectors iterators

    this is my header file

    #ifndef HW1_H
    #define HW1_H
    #include <iostream>
    #include <string>
    #include <vector>

    using namespace std;
  8. Replies
    4
    Views
    848

    Re: vector iterator

    i spend one hour for it . But i forgot a small point :( i found thanks to God. I forgot including Product class. After including, it worked. Thanks for your interest
  9. Replies
    4
    Views
    848

    vector iterator

    Product Store::getProduct(int index)
    {
    int indexim=0;
    vector<Product>::iterator it;

    for ( it=(this->availableProducts.begin()) ; it < (this->availableProducts.end()); it++,indexim++ )
    {...
  10. Re: To Reach a member function of a class from ostream function(class's friend)

    This is the header and it's forbidden to make any change in header.




    class Product
    {

    private:
  11. Re: To Reach a member function of a class from ostream function(class's friend)

    no,there arent. all is mutator
  12. Re: To Reach a member function of a class from ostream function(class's friend)

    Ok. second option is worked. BUt now i want to reach shoppingList vector.It's type of productClass

    and Product class is


    class Product
    {

    private:
    string productName;
  13. To Reach a member function of a class from ostream function(class's friend)

    class Order /* It is forbidden to change here*/
    {

    private:

    string orderID;
    int orderDate;
    string customerID;
    string storeName;
    vector<Product> shoppingList;
  14. Re: adding items to vector class from another class' method or main function

    ok. then how can i print the items which exist in the vector with the help of a function?
  15. adding items to vector class from another class' method or main function

    #include <vector>
    #include <iostream>

    class Product
    {

    private:

    string productName;
    string productType;
  16. Replies
    14
    Views
    3,272

    Re: Dynamic array of struct inside a struct

    ok. I understand. Thanks a lot.
  17. Replies
    14
    Views
    3,272

    Re: Dynamic array of struct inside a struct

    Interestingly , No it is not a mistake .When i compile and run with this:




    memcpy(snacks.ncandy[0].bar_name, &MyChocolate, sizeof(candybar));


    outputs is:
  18. Replies
    14
    Views
    3,272

    Re: Dynamic array of struct inside a struct

    ??
  19. Replies
    14
    Views
    3,272

    Re: Dynamic array of struct inside a struct

    I study the code which is Paul McKenzie's last post and add only couts at last. That's it:



    #include <cstring>
    #include <iostream>
    int main()
    {
    using namespace std;
    struct candybar
  20. Replies
    9
    Views
    1,127

    Re: Why p and q is noT NULL ?

    Thanks for all replies . You informed me very well.
  21. Replies
    9
    Views
    1,127

    Re: Why p and q is noT NULL ?

    No , it shouldn't because in my first thread(i copy paste below) , p is an allocated pointer and q is not an allocated pointer. Both of them doesn't equal Null when i run the program.The output is...
  22. Replies
    9
    Views
    1,127

    Re: Why p and q is noT NULL ?

    I am trying to understand this code.I find it from the web and copy paste directly. The comments are not mine.

    I want you to focus on insert function firstly.


    int create(struct node *p, int...
  23. Replies
    9
    Views
    1,127

    Re: Why p and q is noT NULL ?

    I understand in this way from your words:

    We take space from memory randomly. Thus p is most probably Not NULL but it can be Null ( the possibility of being Null is very low) .

    We don't...
  24. Replies
    9
    Views
    1,127

    Why p and q is noT NULL ?

    #include <stdio.h>
    #include <conio.h>

    struct node
    {
    int num;
    struct node *next;
    };
  25. Replies
    5
    Views
    4,246

    Re: How to make a function change a variable

    the first one doesn't change the value of myKnap.W .
    i have tried the second one and fixed some deficient point in your code. It should be correct.




    #include<iostream>
    using namespace std;...
Results 1 to 25 of 45
Page 1 of 2 1 2





Click Here to Expand Forum to Full Width

Featured