87 Topics

Member Avatar for
Member Avatar for Sarlacc

I am creating multiple C++ DLLs which have a C wrapper around them for use by an external application. I wanted to have a single error handling library that each DLL has access to. If I created the error library as a static library and then include it in the …

0
185
Member Avatar for jkon

There is a problem with static variables and functions in how it is used by apps and frameworks in PHP , they are used as global functions or parameters while this is by far what they mean. It is easy to write the same functional or even procedural code in …

Member Avatar for pritaeas
0
298
Member Avatar for mike_2000_17

# Introduction # A recurring problem many newcomers face when tackling C++ is the compilation process, from sources to binaries. This tutorial will detail that process. It will be especially useful for people only familiar with higher-level languages (if any), but veterans of one or more native languages (C, Fortran, …

Member Avatar for Lutina
15
7K
Member Avatar for theashman88

I know this has been asked before, but I can't find any simple answers for a noob like me in C#. What exactly is a static method. I mean what does it mean to be static vs. nonstatic. I know in the code with the main method we use `public …

Member Avatar for RichardGalaviz
1
305
Member Avatar for diafol

Hello All. Been playing around with some linked dropdowns. It seems to be a recurring theme here on DW, so I thought I'd offer this up as a possible solution or for discussion, to see how it could be improved. The premise for this set of linked dropdowns is that …

Member Avatar for diafol
5
937
Member Avatar for Adami

Hi guys, I wrote the following code: public static boolean match(int[] a , int[] pattern) { //need to use the overloaded method, in order to work with the static method. return match(a,pattern,0,0); } /** This is an overloaded method that match between a pattern to a given string (as an …

Member Avatar for Adami
0
3K
Member Avatar for ravi_14

My header file header.h #ifndef HEADER_TEST #define HEADER_TEST static test_variable; #endif now i am including this in two source files IN THE SAME PROJECT. multiple definition error. i have used static specifier in header file . please help me understand this.i think static makes internal linkage. regards, ravi

Member Avatar for Suzie999
0
139
Member Avatar for moaz.amin.37

hi i can't undestanding this why the main function in java is static and static function can call using class name. And why we declare main function as public. i can not understanding this procedure of main function in java. plz help me.

Member Avatar for stultuske
0
309
Member Avatar for jkhippie

Hi, all. I'm have a class EnemyController with a function Spawn(...) that instantiates a new object of the appropriate type. I want to call Spawn from somewhere like my TileMap class to create a new Enemy in my tile collision method. Here's what I have so far... class EnemyController { …

Member Avatar for jkhippie
0
169
Member Avatar for moaz.amin.37

my question is that when we use static data member and ststic function and nobody can not satisfy me about this question i need actual reason of using the static data member and ststic member function

Member Avatar for deceptikon
0
843
Member Avatar for jwenting

Similarly, you can add more fields to an enum and simply provide accessor methods to retrieve them. For example you could change it to have an extra field indicating an output directory to write specific types of data to, and a getter method to return that directory.

Member Avatar for jwenting
0
243
Member Avatar for castajiz_2

Why isn't the Microsoft built in class Random class an type static class as the Math. class is. Why didn't they make this class static?

Member Avatar for Ketsuekiame
0
361
Member Avatar for ameer.mhmed

method non static public class LoGIne{ public String user (String a){ String rr = txt_user.getText(); String pass = txt_pass.getText(); //ConDb(user,pass); return rr; } --------------------------------------------------- method static public static Connection ConDb(){ //String USER ="mh"; String d ,l,h; d =("ameer"); String PASS=d; LoGIne a = new LoGIne(); String USER = a.user(h); // …

Member Avatar for ViolaPAllen86
0
399
Member Avatar for Tsaou

I keep getting loads of linker errors that probably have something to do with virtual-functions/definitions and/or static class members... I've seen several relevant posts but none of the solutions suggested work, can you see wht the problem is here? My projects consists of 3 files: BALLS.H #include <iostream> using namespace …

Member Avatar for Ancient Dragon
0
505
Member Avatar for Sugondo

i have some problem about link the library to executable. i tried to statically linking but when i create the .a file i always failed, what i want to know is there any way for the exe look up into current directory instead of the system if i has all …

Member Avatar for richieking
0
163
Member Avatar for Labdabeta

Hello, I noticed that in c++ everything that can be done using a static function in a class could be done by using a public function in the same namespace. Assuming that you bind your classes in a namespace these functions do not take up names in the global namespace. …

Member Avatar for mike_2000_17
0
199
Member Avatar for PixelatedKarma

Hey everyone, So I am having trouble getting my head wrapped around a php script I need to build. What I am trying to do is pull data from a MySQL database table (dynamic content) and match it to an html table with static content. I guess an example of …

Member Avatar for PixelatedKarma
0
989
Member Avatar for ronaldpaul

Hi, In Virtual Box I've installed Fedora 17 and setup LAMP development environment. I've set the static ip to access the localhost and the applicaions/projects. Now I would like to configure it as to access them using the static IP from the host machine (Windows 7 OS). How can I …

Member Avatar for CimmerianX
0
273
Member Avatar for CPT

currently I have a class function: class MyClass{ static int E(int A,int B, int C){ //function code } }; //and I call it like this : MyClass::E(1,2,3); //what I would like to do is call it in this way: E(1,2,3); //my current macro definition is this #define E(a,b,c) Myclass::E((a),(b),(c)) how …

Member Avatar for JasonHippy
0
306
Member Avatar for kiLLer.zoh_1

this is my contacts class <?php class contacts { private $name; private $cno; private $clocation; public function __construct($name,$cno,$clocation) { $this->name = trim($name); $this->cno =trim($cno); $this->clocation=trim($clocation); } public function getName() { return $this->name; } public function getNO() { return $this->cno; } public function getLocation() { return $this->clocation; } } class DataBaseAction …

Member Avatar for kiLLer.zoh_1
0
295
Member Avatar for sliobra

I was doing my assignment till I reached this point. Add a static Date toDate(String str) method to the DateTest class. If the method is called with a string like “23/5/2013”, it will create and return the corresponding date object. If the input string is not valid date, the method …

Member Avatar for JamesCherrill
0
192
Member Avatar for saurabh.mehta.33234

The following code gave error on gcc compiler int main() { extern int a; printf("%d",a); return 0; } static int a=5; But when static is removed from int a then it runs with no errors..Can someone please clear the doubt??

Member Avatar for saurabh.mehta.33234
0
309
Member Avatar for nickerst

So I have been working on this project for quite some time and I can't figure out why I keep getting an "Illegal Start of Expression" error. I tried moving the variables above the main method and that only returned the same error but instead of the error occuring at …

Member Avatar for nickerst
0
318
Member Avatar for Eyeteeorg

I'm just learning html but already have a domain, so I did a quick and dirty under construction page to replace the advertising-littered default page that the webhost was using. It's dirt-simple and not very good, but I'll make it better as time goes on. Is there any rule I'm …

Member Avatar for margaret224
0
209
Member Avatar for vikuseth

Programe #1 inside file.h class File { public: static const int var = 9; }; inside main.cpp #include <iostream> #include "file.h" using namespace std; int main() { File f; cout << f.var; return 0; } Programe #2 inside file.h int Globalvar ; class File { public: static const int var …

Member Avatar for mike_2000_17
0
226
Member Avatar for marnun

Here is the exercise: > fileWord > Write the definition of a function named fileWord that receives a string argument that is the name of a file containing words. > > The first time the function is called, it returns the first word of the file whose name it was …

Member Avatar for marnun
0
259
Member Avatar for James19142

I need a way to do a cast without being returned a pointer to a new address but, the same address as the original. Something like this: derivedClass something_derived; baseClass* basePointer = &something_dervived; derivedClass* derivedPointer = static_cast <derivedClass*> (basePointer); /* my problem is "derivedPointer" isnt assigned the same address as …

Member Avatar for James19142
0
185
Member Avatar for anoushka
Member Avatar for tabj

I need a help? I m designing a webpage. I have used <**div**>s everywhere, from header to footer, moreover I have used **relative** **positioning** with **top** and **right** tag. Somewhere top value has gone -1200 and so. At last I m left with about 800px of useless area below the …

Member Avatar for lps
0
852
Member Avatar for Pyler

I use dr java for linux to run my code. I've been running into a bunch of errors recently while running this simple program. The code compiles fine but whenever I run the java file, I get the error; Static Error: Undefined name here's my code; (I've got two files, …

Member Avatar for TrustyTony
0
2K

The End.