19 Topics
|
|
|
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 … |
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 … |
|
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; … |
|
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`? |
|
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 … |
|
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 |
|
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 … |
|
|
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 … |
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 … |
|
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; … |
|
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 … |
|
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 … |
|
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. |
|
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 |
|
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'); |
|
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 … |
|
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 … |
|
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 … |
|
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: … |
The End.