28 Topics

Member Avatar for
Member Avatar for Olyboy16

Please geeks how can i use/access the initialization list for my class. So that can do something like this... MyClass foo = {value,value,value};

Member Avatar for Olyboy16
0
98
Member Avatar for can-mohan

Hi, While executing below code i am getting error like "memory clobbered before allocated block" and due to this assignment is not happening. could you let me know what can be reason for the same. I do understand it is not good to use raw pointer but in current scenario …

Member Avatar for can-mohan
0
443
Member Avatar for SamD34

Hi, I want to declare a float[] in .h and initialize in .m as explained below: .h file ` @interface A: NSObject { float data[10]; } @end ` .m file @implementation A -(void) loadData{ data={1,2,3,4,5,6,7,8,9,10};//Does not work } @end I could have intialized in the following manner, but Could it …

Member Avatar for great_learner
0
317
Member Avatar for bleedi

Hey there, I've got a small problem. I'm writing an UDP client-server system, and I wanted to use streams with UDP. I found [UDPOutputStream](http://www.java2s.com/Code/Java/Network-Protocol/UDPOutputStream.htm) source and pasted it into my project. Now, when I try to initialize it, it freezes. This is how I try to initialize it: outStream = …

Member Avatar for bleedi
0
270
Member Avatar for Skate Bart

Hi there. I developed a program that creates Data Reports using this way : [Click Here](http://www.vbtutor.net/vb6/lesson40.html) But instead of using "Microsoft Jet 3.51 OLE DB Provider", I used "Microsoft Jet 4.0 OLE DB Provider" because when I used "Microsoft Jet 3.51 OLE DB Provider" it couldn't connect to the database …

Member Avatar for Skate Bart
0
588
Member Avatar for tischn

Hi i had never before used structures, so i am a complete noob ;) . this is a small Part of my programm: struct player { int var1; int var2; int var3; int var4[10]; int var5; int var6; }; struct player p[4]= {{1000,0,0,{0,0,0,0,0,0,0,0,0,0},0,1}, {1000,0,0,{0,0,0,0,0,0,0,0,0,0},0,1}, {1000,0,0,{0,0,0,0,0,0,0,0,0,0},0,1}, {1000,0,0,{0,0,0,0,0,0,0,0,0,0},0,1}}; printf("%d\n"), p[0].var1; printf("%d\n"), p[0].var2; …

Member Avatar for tischn
0
136
Member Avatar for rajesh1158

public class Twisty { { index = 1; } //need clarification here int index; public static void main(String[] args) { new Twisty().go(); } void go() { int [][] dd = {{9,8,7}, {6,5,4}, {3,2,1,0}}; System.out.println(dd[index++][index++]); } } In the above code, inside the instance initialization code, index is used. But it …

Member Avatar for JamesCherrill
0
146
Member Avatar for bgx90

I have not found anything that addresses these questions. Any help is appreciated. If I have a class that has pointers to objects of a user-defined class as members, is there any problem with initializing those pointers with the initialization list of the constructor? For example, where A, B, and …

Member Avatar for bgx90
0
3K
Member Avatar for engineerchica

Hi all, My code for a function to count words is posted below, and the only error that appears when I build it in my compiler is that char present is uninitialized. My program will not run with this uninitialized value. I've been searching for info on how to initialize …

Member Avatar for engineerchica
0
457
Member Avatar for codechrysalis

ok so im making this console app in which I have to allow the user to enter any number of values then display orignal value , and then the percentage of the original value to the total. [B]My question is how do I initialize my memory locations correctly for a …

Member Avatar for codechrysalis
0
223
Member Avatar for PrimePackster

Well I just want to know, how to give variable size for an array(Particularly, second subscript). For example, like this [CODE]#include<iostream> using namespace std; int main() { int a,b; cout<<"Enter the size for the 2D array"<<endl; cin>>a>>b; int*A=new int[a][b];[/CODE] for a its ok, But how to make it work for …

Member Avatar for PrimePackster
0
315
Member Avatar for Kyle Willett

I'm doing a program that is supposed to reverse a string entered my the user using a recursive function, I almost have it solved except for one little elusive bug that I can not understand. [CODE] //****************************************************************************** //Programer: Kyle Willett //Course: CS-1513 //Program: 3 exercise 7 page 933. //Purpose: Reverse …

Member Avatar for Kyle Willett
0
209
Member Avatar for sjcomp

Hello, I am using a singleton pattern, which works fine. But when I decided to have a singleton of a nested class that is privately declared. [CODE]class A : public CSingletonTmpl<A> { class B : public CSingletonTmpl<B> { }; }; A* CSingletonTmpl<A>::s_Singleton = NULL; A::B* CSingletonTmpl<A::B>::s_Singleton = NULL; [/CODE] The …

Member Avatar for madGambol
0
244
Member Avatar for Gribouillis

This snippet defines a decorator to automate attributes setting in class instances at creation time. It can be seen as a gadget feature but it can also be handy especially for fast class prototyping.

Member Avatar for Gribouillis
0
255
Member Avatar for androidz

I use the splash screen of the vb.net found on windows form.Is there a way that i could put an initializing while my splash screen is running?like other programs do instead of progress bar. thank you.

Member Avatar for Netcode
0
281
Member Avatar for ispeakbinary

I am trying to create a class for doing number factorization on a random number, so I need to create a pointer to store the factors of the number. But when I compiled it, I got an error. My question is 1)What did I do wrong? I have a feeling …

Member Avatar for csurfer
0
156
Member Avatar for SoftwareGuy

Hi. This is probably too easy, but... Can anyone tell me how to add or remove a checkbox from a panel by using the Designer? The only samples I could find online had the code nside an arbitrary method called CreateMyPanel(). I'm looking at a file called MyControl.Designer.cs, and inside …

Member Avatar for SoftwareGuy
0
215
Member Avatar for techie1991

I was trying to code the assembly line sheduling problem using the dynamic programming approach. I have coded the program but i am facing problem with the 2-dimensional arrays I am using. For testing purpose, I wanted to initialize the array, but I was not able to get it. Moreover, …

Member Avatar for Fbody
0
203
Member Avatar for Garrett2011

considering visual C++ compiler, Lets say I've got a file with whatever extension and it contains 100 bytes of data which are exactly the data that I want to initialize an array of char data type with a length of 100 characters with, Now apparently one way is to read …

0
149
Member Avatar for Muincat

Hi Everyone In the interest of not hijacking someone else' troubleshooting thread, I'm starting a new one, but I don't know if anyone will be able to help me at this point. Here's the situation: I passed an older HP computer "sight unseen" on to a friend to let his …

Member Avatar for Muincat
0
668
Member Avatar for Sunshineserene

I have a program with arrays declared in the main function. However, when I want to use that array in my init() function, it doesn't work. May I know what must be done so that I can use my arrays in the init() function?

Member Avatar for NormR1
0
234
Member Avatar for Garrett2011

take following class and two object definitions: [CODE=c++] class Rect{ public: enum centimeter; enum meter; Rect(double len,double wid,enum centimeter){ length=(len/100); width=(wid/100); } Rect(int len,int wid,enum meter){ length=len; width=wid; } //rest of implementation private: double length;//in meters double width;//in meters }; Rect obj1(10,5,Rect::centimeter()); Rect obj2(10,5,Rect::meter());[/CODE] two previous constructors have dummy enum …

Member Avatar for Garrett2011
0
2K
Member Avatar for Garrett2011

take two following classes: [CODE=c++] class Test1{ public: Test1()=default; Test1(char in1,char in2):char1(in1),char2(in2){} char char1; char char2; }; class Test2{ public: Test2()=default; Test2(char in1,char in2):char1(in1),char2(in2){} private: char char1; char char2; };[/CODE] I know in c++0x both of these classes are considered as POD types and we can initialize objects of them …

Member Avatar for Garrett2011
0
273
Member Avatar for Garrett2011

take two following classes and their constructors as samples: [CODE=c++] class One{ public: One(int a,int b):adad1(a),adad2(b){} private: int adad1; int adad2; }; class Two{ public: Two(int input[]){ for (int i=0;i<10;i++) araye[i]=input[i]; } private: int araye[10]; };[/CODE] considering objects with static storage duration, I think first constructor can be applied during …

Member Avatar for Garrett2011
0
311
Member Avatar for Garrett2011

Suppose we have following two classes: [CODE=c++] class Temp{ public: char a; char b; }; class Final{ private: int a; char b; char c; public: Final(Temp in):b(in.a),c(in.b){} //rest of implementation };[/CODE] can we initialize an object of the Final class with following syntax in upcoming c++0x standard: [CODE=c++] Final obj(Temp{'a','b'});[/CODE]

Member Avatar for mike_2000_17
0
250
Member Avatar for TurboCoding

I have used IT++ for half a year, which is a C++ liabrary. Recently, I got a problem when I try to write the HEADER file for a class, with a member which is another class object. Here is part of my code: [CODE] class A { private: fixvec fv; …

Member Avatar for TurboCoding
0
164
Member Avatar for Fbody

I just started an advanced C++ course and my instructor sent around a file with this piece of code: [code]class smallobj // specify a class { public: smallobj() : iData(0){} // Constructor smallobj(int iInValue) : iData(iInValue) {} // Overloaded Constructor ~smallobj() {} // Destructor void setdata(int d) // member function …

Member Avatar for Fbody
0
1K
Member Avatar for tzushky

Good morning coders !, I stumbled accross an initialization this morning and even though I get it , it's not 100%. I'll simplify it this way: I have an array declaration: [CODE]uint8_t MyArray[MAX_SIZE][/CODE] I have a linked list structure: [CODE]struct MyLL{ struct MyLL * next; struct MyLL * previous; uint16_t …

Member Avatar for tzushky
0
481

The End.