9 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for nathan.pavlovsky

Hi programmers! I am trying to grasp the concept of friendship. Let's say that we have the following: class List; //forward declaration class ListNode { friend class List; //make List a friend /* rest of code here, blah, blah, blah. */ } Does this mean that ListNode can access Lists's …

Member Avatar for nathan.pavlovsky
0
209
Member Avatar for oanahmed

Hi! I'm a student learning C language. During my exercise I have faced a weird problem(atleast to me). I have encountered two declarations: int size; int arr[size]; I'm unable to figure out the actual dimension of the array and its lenght as the variable `size` is only declared not defined; …

Member Avatar for oanahmed
0
339
Member Avatar for Pyler

What is the difference between `CoffeeInterface<Beverage> cup1 = new Coffee<Beverage>()` and `Coffee<Beverage> cup2 = new Coffee<Beverage>()` `Coffee` is a class that extends the `CoffeeInterface` Is `cup1` an object or can it be used as one. Are there any differences betweeen `cup1` and `cup2`?

Member Avatar for JamesCherrill
0
242
Member Avatar for Kryptonitex

I got 2 Declaration syntax error... i really need help :D Thanks! Btw .. i'm using Borland C++ #include<iostream.h> #include<graphics.h> #include<stdlib.h> #include<stdio.h> #include<ctype.h> #include<conio.h> void main() {clrscr(); int opt,opt1,opt2,opt3,opt4,opt5,opt6; /* request auto detection */ int gdriver = DETECT, gmode, errorcode; int style, midx, midy; int size = 1; int x,y; …

Member Avatar for Kryptonitex
0
221
Member Avatar for DaveTran

I have two classes. One main Game class and an Entity class that needs to point to the Game class so it can call its various functions # Entity.h # class Game; class Entity { public: Entity(Game *game); ~Entity(void); void Draw(float dt); void Update(float dt); protected: Game *m_game; // Missing …

Member Avatar for JasonHippy
0
402
Member Avatar for veledrom

Hi, Is tere any difference between these two codes or is it just a matter of taste? Thanks var days = new Array('Sunday','Monday'); var days = Array('Sunday','Monday');

Member Avatar for veledrom
0
122
Member Avatar for boiishuvo

That is a little homework for myself. I was trying to make a simple program that you entry your name (acts as a password) and if it's on the list then you may access, otherwise (aka else) you're not allowed to access. The problem is I can't put more than …

Member Avatar for zeroliken
0
184
Member Avatar for James19142

i made a header file with my function declarations and the cpp file with the definitions. While making the definitions in the .cpp file i included the header and from the highlighted text the definitions seemed to match declarations in the header. In the header the the declarations were able …

Member Avatar for James19142
0
852
Member Avatar for Efficience

I have written this C code in which I'm declaring a variable inside switch body with initialializing it to 10.But when I'm running this code it is printing some garbage value. [CODE]#include <stdio.h> int main() { switch(2) { int x=10; case 1: printf("Case 1: %d\n",x); break; case 2: printf("Case 2: …

Member Avatar for Efficience
0
448

The End.