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
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
4K
Member Avatar for dyingatmidnight

Hello, I've been in the process of teaching myself C++, going through different tutorials and like. Anyway I was working on a fibonacci sequence program - I looked through the practice problems here and decided to do them all from beginner on upward. I thought I had it working only …

Member Avatar for Jimmy_7
0
211
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
168
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
235
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
88
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
135
Member Avatar for sairus

can you help me on how to convert the numbers into words . here is my example on how to do that program but im not sure if this is a correct program.. #<iostream.h> #<conio.h> int ones,tens,hundreds main() { cout<<"ENTER NUMBER"; cin>>number; cout<<"ENTER ONES"; cin>>ONES; if(number==1); cout<<"one"; else if(number==2); cout<<"two"; …

Member Avatar for WaltP
0
1K
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
204
Member Avatar for turista

Hi i saw a post about this program already. im new to c++ and im lost... completely lost... im not even sure im posting this in the right place. anyways. the program i got is working correctly until i make it an OOP which is what my teacher wants us …

Member Avatar for Chilton
0
244
Member Avatar for hawita

i am trying to write a program to play the Battleship game;It is not a homework problem just a practice problem. The instructions are: set up a coordinate grid, select your own ships and locations while the computer selects its own; launch missiles by entering coordinates and accept hits from …

Member Avatar for Nicco
0
482
Member Avatar for cossay

The program below crashes anytime I run it, can anyone tell what I have done wrong?. [CODE] #include <iostream> #include <cstring> using namespace std; class Human { private: char *fname; char *srname; char *phone; public: char * getFirstName(); char * getLastName(); char * getPhone(); Human(char *fn, char *sn, char *ph); …

Member Avatar for Tomi1988
0
140
Member Avatar for manofhouse

Program is suppose to convert binary to hex.. it says that i need a class/struct/union to the left of ".substr" but im pretty sure convert should be working.. [CODE]#include <iostream> #include <string> using namespace std; int main () { string convert [8]; string bin[16]= {"0000", "0001","0010","0011","0100","0101","0110","0111","1000","1001","1010","1011","1100","1101","1110","1111"}; string hex[16]= { "0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"}; …

Member Avatar for Tomi1988
0
411