611 Posted Topics

Member Avatar for Syafiq_1
Member Avatar for richieking
0
181
Member Avatar for vampersie

And if i were you, i will bring in the class object inside the main. Then the initialize fucntion a template so that you can use that for both class. template<class T, int size> void init(T, size){ // Then you can initialize all you class }

Member Avatar for vampersie
0
123
Member Avatar for Learner010

As deceptikon has explained earlier, I also wish to add something further to it. `*(0+a)` is equal to calling `*a` or `a[0]`. when you add the ofset data to the pointer` *(2+a)` , you just ask the pointer to move to the said memory space then defference the pointer with …

Member Avatar for richieking
0
190
Member Avatar for molu

Thats very simple and easy. wow... so simple task. But no one willdo that here for you. oooch! So if you want our attention.... then show some code will you?

Member Avatar for kellyperry15
0
278
Member Avatar for Learningvinit

counted_ptr must be a template/generic type which is well designed. template<class T> count_ptr{ count_ptr():t(tp){} operator()(){} operator +(){} operator=(){} private: T t; }; int main(){ //class foo object bar foo bar; // now count_ptr serves as a container that can accept and manipulate class //foo objects. count_ptr<bar> count_ptr_bar. } get back …

Member Avatar for Learningvinit
0
525
Member Avatar for Sugondo

If you need more info about linux .so link. Get back for that ok? The concept is not too different.

Member Avatar for richieking
0
167
Member Avatar for daino

there are various questions that comes to mind. 1. how was the main file written? ie. is it encrypted ? -if yes, you will need the encrypted key/pass to get the real data. - if no, then you must know how to use the compressed lib verywell to use it …

Member Avatar for daino
0
196
Member Avatar for ranar

Your problem is number 12 in the while loop. The logic was not right. try this string data; static int count=0; while(getline(d_file,line)){ data +=line; count++; if(count==2){ user_vec.push_back(data); count=0; } } you caould have had the data setup the way you want before inserting into the vector. Its called planning.

Member Avatar for ranar
0
390
Member Avatar for Learner010

printer is a very low-level stuff. there are hundreds of libs out there but you must consider a GUI like QT thats a multi platform. The best GUI in town.

Member Avatar for Ancient Dragon
0
229
Member Avatar for waqasjani
Re: oops

start with some googling ok? Here we do not teach people but we share ideas. Its a give and take show. not take take ok? come again when you want to comply. Thank you.

Member Avatar for rubberman
-1
210
Member Avatar for VUEKID
Member Avatar for VUEKID
0
421
Member Avatar for bad.boy.Vlad
Member Avatar for tbuchli

Your code runs without error on my ubuntu Qt5.1. Can you post your error?

Member Avatar for richieking
0
282
Member Avatar for atzounis

lambda is also another way out. consider looking into that. I personally like lambda when it comes to what you are requesting. Clean and mmm simple. That is depends on your knowledge with cpp11.

Member Avatar for NathanOliver
0
269
Member Avatar for moon.fall.58

online 43. set up a static int counter =0; then increment the counter in the while loop . check with if the counter is equall 3 break or else keep asking for the password to be entered correctly. simple.

Member Avatar for richieking
0
1K
Member Avatar for MrAlicard

so what have you done personally here. Do something, show your errors and we might/may help you. Thats how we do it over here.

Member Avatar for MrAlicard
0
122
Member Avatar for klemek

Also i guess you need to look into recursive fucntion as you could accomplish this task easy with that. i hate long codes. it makes me wanna sleep. long codes are more error prone.

Member Avatar for richieking
0
148
Member Avatar for pro.soltan

Also consider xml type as its more structured. Thats depending on your level lol. My favorit here is sqlite but i guess you wont need that for now. Experiment.... keep on.

Member Avatar for richieking
0
91
Member Avatar for andrew mendonca

No one will go the those link for you. Provide your code and your errors and we might have a look at them. we dont get paid for anything here... remember that.

Member Avatar for richieking
0
208
Member Avatar for prettyknitty

Asigning array of the same data type which is bigger copies the data. so i think its more efficient this way. nt *exp(int *,int); int main(){ int ar[]={4,3,7,5,7,8,6,5,4,2}; int *foo; foo = exp(ar,10); for_each(foo,foo+10,[](int &c){ cout <<c<<endl;}); return 0; } int *exp(int *arr, int size){ int *temp=new int(size*2); temp = …

Member Avatar for Ancient Dragon
0
913
Member Avatar for cambalinho

int main(){ std::fuction<void(const &a,void)>pp =&a::message(); pp(); return 0; } you need to write your class well. look into it more cpp0x help on fuctional.

Member Avatar for richieking
0
142
Member Avatar for Sonu_2

You need to run your pointer in a loop and randomly insert NULL. pseudo code... for(n=0;n<10;n++) for(y=0;y<10;y++} if(y%2==0) p[y][x]=NULL; p[y][x]=y+x; Hope this help.

Member Avatar for richieking
0
335
Member Avatar for Wayne.H94

should be a pratice to always use int main(). Main in cpp is not void. With your args, i think you are not entering it right or some other stuff you are not doing it right.

Member Avatar for owenransen
0
171
Member Avatar for VUEKID

The code seems too much C style to me. why couldnt you just use a proper CPP style. And could even make it 3 lines once you get the idea. ifstream file("text.txt"); //open file string stuff,cc; if(file.is_open()){ // check file if success while(!file.eof()){ file >> stuff; // put line date …

Member Avatar for VUEKID
0
181
Member Avatar for SpottyBlue

Open your file before the do statement on number 27. You keep opening file which is already open.. That can truncat data and most compilers will give fatal error. Its not done. put it ouside the loop. Also use `string ans = ifFile.is_open()?" file open ":"Error";` Not specifially this style …

Member Avatar for richieking
0
279
Member Avatar for lehlohonolo.mohaila

your code is even more error prone. memory leaks. new allocation always need to be freed. On line 16. for something simple like this, there was no need using new alloc. just simple const int foo=10; int afoo[foo]; something more simpler and effective for basic data ops. The point is …

Member Avatar for happygeek
-1
393
Member Avatar for augustine.kumi.3
Member Avatar for mesut12
0
122
Member Avatar for suhasgh

Guys looking at the post carefully, the poster's code is still not answered. He wanted to print a linklist data and then delete the last node. looking at his print function, it looks like he was trying to build a doubly link list not a single list. This is why …

Member Avatar for ookhan
0
188
Member Avatar for sris20013

maybe he needs a const char* just to print it out. what else ?.... can we both agree that he should get back to basic oop and data types classroom again. just my opinion.

Member Avatar for Jamblaster
0
132
Member Avatar for roidbeginnerlvl

Try this style. Also you can read the value into an array or just cout. Its even more easier once you know that value format remains the same. using namespaces std; string line = "foo: bar: boo:tuna"; string del = ":"; size_t pos = 0; string token; while ((pos = …

Member Avatar for richieking
0
203
Member Avatar for andrew.mendonca.967

MixedExpression.cpp. Look at line 94 bout printdata method. The logic is not right. You seem to read data to out output file object but not printing to screen. check your logic and debug well.

Member Avatar for tinstaafl
0
339
Member Avatar for skyyadav

A dongling pointer. This is C++ not VB or Javascript... no var variable here please.

Member Avatar for richieking
0
142
Member Avatar for happygeek

I think the speed of new releases of python is not a good idea. Python have so many releases and they break things. GUI's like [B]wx,QT,GTK [/B]cant keep up with this mess. I know tk is there. But who uses tk for serious stuff.? Why cant they make LTS releases. …

Member Avatar for vegaseat
0
741
Member Avatar for sharan_1
Member Avatar for richieking
0
161
Member Avatar for deonis

check with the bind method name( event handler method). its different to the method name it calls. self.Color is not the same as onColor.

Member Avatar for deonis
0
945
Member Avatar for pythonforlife

you need to put the ode that opens the file in try-except braces. Then open a wxMessagebox inside the catch(exeption) brace. Its been along time i worked with wx but the style and logic is the same on GUI's. try{ open file() } except(msg){ wxMessageBox(values,message,...) }

Member Avatar for bumsfeld
0
460
Member Avatar for lewashby
Member Avatar for james.lu.75491856
0
225
Member Avatar for RascelleGrepo

you need to include ctype header. then once you recieve the input you check with isdegit() method. its a bool method so you do if statement.

Member Avatar for deceptikon
0
1K
Member Avatar for stealthless

hay buddy work on this . i have not check it but should work. chunk_val = raw_input("chunk values : ").lower() # values to search check_val = raw_input("check stuff : ").lower() # search values. dont repeat search values. eg values appears once for checking data ={} #dir to keep distinct for …

Member Avatar for edward.okech.5
0
256
Member Avatar for waqas.zafar.125

You dont seem to have a 2d array here my friend. 2d array is only col and row. once you name int cols1 and int cols2 then int rows1 and int rows2. You got 4d array. Understand that 2d arrays are rows and cols. no more no less so get …

Member Avatar for Kanoisa
0
165
Member Avatar for 68thorby68
Member Avatar for 2384443

it is function / method overloading. operator overloading is quiet a different stuff. ))

Member Avatar for richieking
0
142
Member Avatar for oomotayo

you can sum the value from an array in a very simple style. eg; <?php $value; // Array value contain 40 int; $array_int[39]; // Now sum the stuff; for($value=0;$value < count($array_int);$value++){ // Sum the value from the array $value +=$array_int[$value]; } echo "the Ssum is "; echo $value; ?>

Member Avatar for diafol
0
172
Member Avatar for sntoane
Member Avatar for juan.sancen.7

while(inFile.good()){ // read the file content } Thats another way to read file content. listen to vernon... he has given more information than you needed. You can also get the size of the file and read the content in little chunks.

Member Avatar for deceptikon
0
216
Member Avatar for AutoPython
Member Avatar for Ravish.Ahmad.Khan

There are 2 thing that may help fix your problem. At least anyone of them is enough for the task. 1.Thread 2.javax swing Timer. 1.if you need thread then you will need to call the runnable method to innitiate the clock. This must be called in an event. 2. If …

Member Avatar for Schol-R-LEA
0
229
Member Avatar for PinoyDev
Member Avatar for nostalgia

Also you can bring the innitializing of the `int[] values = new int[numbValues];` into the constructor. Object(int numbValues) { values = new int[numbValues]; this.numbValues = numbValues; } but leave the declaration outside . that is `int [] values;' By this you will be fine also. that means you will need …

Member Avatar for richieking
0
224
Member Avatar for kt9871

this is a clue... public stack <datatype> foo = new stack<datatype> foo(); public Node <stack> nfoo = new Node<stack> nfoo(); now you can put stack into node.

Member Avatar for kt9871
0
431

The End.