Questions tagged [global-object]

39 questions
0
votes
3 answers

Object created on the heap is not global?

I read a book S. Lippman "inside c++ object model", is there such code class Foo { public: int val; Foo *pnext; }; void foo_bar() { // Oops: program needs bar's members zeroed out Foo bar; Foo* baz = new Foo(); // this line i added myself if (…
user1886376
0
votes
2 answers

iOS common objects

I'm writing an iOS app where there is a common object that all views within the app need to access. I have been creating, and initialising the object within the viewDidLoad event (of the first view controller), and then passing a reference to this…
Sabur Aziz
  • 236
  • 1
  • 2
  • 9
0
votes
1 answer

Why is Singleton a better choice than Global Objects

Hello Stack Overflow. I'm studying for a CS exam I have tomorrow and I'm looking over the review sheet that our professor provided for us. One of the points says to know why Singleton is a better choice than Global. I'm not exactly sure the…
ModdedLife
  • 669
  • 2
  • 11
  • 24
0
votes
2 answers

Unable to update the value of a public object

my problem is i am not able to update the value of an object array... The code is : public class GlobalVariable { public int noOfSms = 0; public CheckingClass object = new CheckingClass (); public static void main(String[] args) { …
user1318860
  • 67
  • 1
  • 4
  • 10
0
votes
2 answers

Need to detect which