19 Topics

Member Avatar for
Member Avatar for Nathan_6

Hi everyone. I am makng a RISK game and I am working on a territory class here, and I got a strange message that my google searches have not shed any light on. My code is below. First, my header file: // Class represents each individual territory on the map …

Member Avatar for rubberman
0
528
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 Vasthor

http://s11.postimg.org/kxl3cemw3/error.png this is the least error that I can get from multiple time of debugging. [TheCodeFile](http://www.fast-files.com/getfile.aspx?file=70535) StrBlob.h has needed to use something from StrBlobPtr.h and StrBlobPtr.h needed to use something from StrBlob.h I did tried to #include each file on each other respectively, but ofcourse that would be a data …

Member Avatar for Vasthor
0
377
Member Avatar for amitkumarmailid

declare and assign value to variable at runtime in C# variable names are stored in database(sql server). how can i able to declare varible with these name during runtime. after that assign value... thanks. amit

Member Avatar for Ketsuekiame
0
264
Member Avatar for mattboy64

I'm coding an inventory program in C and I need the variable "stock1" in more than two seperate functions I'm not sure as to how they're supposed to be manipulated and read by the seperate functions nor do I understand how to declare them If I declare them as global …

Member Avatar for mattboy64
0
221
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 Pyler

consider public class awah{ private int x=0; private int y; private int w; public awah(int width){ w=width; } public void sety(){ y=(Int)(Math.random()*4);}//meth1 public int gety(){ return y; } public void setx (){ x+=this.gety(); } public int getx(){ return x; } public void showUpdate(){ System.out.println(x); } }//end of awah public static …

Member Avatar for Taywin
0
215
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 DeHF

I need a little bit of help here. I'm new to C++ Classes. There are some errors which I do not know how to troubleshoot. The error of "Declaration terminated incorrectly" for line 6 and 7. Multiple errors of "Type name expected". Why is that? Multiple errors of "Declaration missing …

Member Avatar for WaltP
0
311
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 rahul pareek

When i declare array in c before main method it gives, an error. Declaration is char a[65000]; main() {} and another declaration in other file char a[63000]; main() {} has no error what is the reason.

Member Avatar for rithish
0
213
Member Avatar for rahul pareek

char a[5000]; main() {} and in another file main() { char a[5000]; } after compiling both file. exe of both file size have large difference. why

Member Avatar for deceptikon
0
270
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 black22622

Turbo C++ is showing declaration syntax error with this statement. Help. void main() { test s; int ch,roll; char name[30],choice,join; clrscr(); It is showing the error with the ' { ' . I have used proper header files and stuffs, and this is just a part of my 700 line …

Member Avatar for raptr_dflo
0
4K
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
850
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
447

The End.