Posts
 
Reputation
Joined
Last Seen
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
0% Quality Score
Upvotes Received
0
Posts with Upvotes
0
Upvoting Members
0
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
1 Commented Post
0 Endorsements
Ranked #4K
~8K People Reached
Favorite Forums
Favorite Tags
c++ x 10
java x 5
c x 1

12 Posted Topics

Member Avatar for Tomi1988

Hi! I am not too expert in C++ programming. I created a class (Pig), then I created an object (Jack the Pig). In the function Kill, I call the destructor, but it doesnt't "kill" (destroy) my Jack the Pig, because in the next line, I can feed him. So my …

Member Avatar for S_915
0
5K
Member Avatar for dyingatmidnight

int can be used from –2,147,483,648 to 2,147,483,647. Use instead of int double! void fibonacci(int loop){ double one = 0; double two = 1; for(double i = 0; i < loop; i++) { if(i == 0) { cout << i << ": " << i << "n"; } if(i == …

Member Avatar for Jimmy_7
0
213
Member Avatar for Tomi1988

Hi! I'd like to create a simple table game by Swing. I have a JFrame and a JPanel variable. I want to add JButtons to this JPanel, but I'd like to create an own class. I made a class that extends JButton (inheritence): public class GameField extends JButton {...} So …

Member Avatar for JamesCherrill
0
171
Member Avatar for Tomi1988

I give the value of three reference types (Integer,String,List) to a function to change it. But only the value of List changed, but Integer and String are reference types too. Why can't I change their values too? public static void main(String[] args) { Integer i = new Integer(1); String s …

Member Avatar for JamesCherrill
0
242
Member Avatar for Tomi1988

Hi! Which way is the more effective? Is there any difference? If I give value to a variable in the class public class A{ int a = 3; } or if I give value to a variable in the constructor of the class public class A{ int a; public A(){a=3;} …

Member Avatar for ObSys
0
94
Member Avatar for Tomi1988

I have a class (Point2D), and an instance variable (double tav) in this class. I would like to compare different Point2D objects (based on variable "tav") by the relational operators (<,>). (a < b) means that (a.tav < b.tav). Is there any way to solve this problem? public class Point2D …

Member Avatar for JamesCherrill
0
141
Member Avatar for sairus
Member Avatar for Tomi1988

Hi! I created an object (Jack the Pig) in the dynamic memory (heap). Because it is a pointer, I can erase it by delete. So I deleted Jack the Pig, but it is not deleted, because Jack->Row function still is working (writes out Rooooow). Why can Jack->Row function still work, …

Member Avatar for mrnutty
0
207
Member Avatar for turista

[CODE] // Menu Chooser.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <string> #include<iostream> using namespace std; class MenuChooser { public: MenuChooser() { cout << "Difficulty Levels\n\n"; cout << "1 - Easy\n"; cout << "2 - Normal\n"; cout << "3 - Hard\n\n"; enum level {easy …

Member Avatar for Chilton
0
257
Member Avatar for hawita
Member Avatar for cossay

And in the destructor: [CODE]Human::~Human() { fname = 0; delete fname; srname = 0; delete srname; phone = 0; delete phone; cout<<"Destructor called."<<endl; }[/CODE] It is more secure to set the pointers to null.

Member Avatar for Tomi1988
0
144
Member Avatar for manofhouse

I think you should use: convert[0]= binfinal.substr (0,4); Because you want to cut the binfinal string, not the convert. Before it, you have to ask for the input.

Member Avatar for Tomi1988
0
421

The End.