Question : Returning 0 from a template member function when instantiated with aggregate types

I have been struggling with indicating "empty" for a pop call in a fifo queue,  when the queue is a template.   I first wrote it for char.  Now I want it to work for ints and aggregate types, say one containing two integers.  The code below works fine if the queue contains chars.    But its a problem with ints, since you can't tell the difference between getting an integer that has the value zero, and getting a result that says the queue is empty.   Things are even worse when T stands for an aggregate type, say with two ints, since then of course sending back 0 won't even work.... How is the problem of the "queue empty" return value handled when you have a member function that is in a template type?

 //remove a character from the front of the queue
 //char pop();
  T pop(){
   T x;
   if (num_items == 0)
   {
       return 0;
   }
   else
   {
     x = queue_array[qfront];
     qfront = (qfront + 1) % capacity_of_queue;
     num_items --;
     return x;
   }
 }//end pop  

I

Answer : Returning 0 from a template member function when instantiated with aggregate types

Again, not knowing this box, I have a few more questions:

1). Does it allow more than one device to be connected at the same time?
2). Did you have to "add" the laptop, or it just added?
3). What error do you get? Timeout? Bad Password?
4). Make sure the WEP is set to

On the iPad, reboot it as well. Press and hold power, and shut it ALL THE WAY DOWN and restart it. See if that helps.

Lastly, try FORGETTING the network on the iPad. When it shows up, click the small  right arrow, and on the next screen, say "forget this network".  Then, when you select it again, it should ask for the password again. Type it slowly, as if you make a mistake, it sometimes just remembers this bad password and refuses to connect.

I have seen both my iPhone and iPod touch fail to connect exactly the same way, and rebooting the device and forgetting the connection helped.

Let me know if this helps.
Random Solutions  
 
programming4us programming4us