Questions tagged [static-functions]

124 questions
1
vote
3 answers

redefinition of static function in case of inheritance

class base { public: static void func() { cout<<"in base class\n"; } }; class derived: public base { public: void func() { cout<<"In derived class\n"; } }; main() { derived d; d.func(); } If I make a function static in…
neharika
  • 75
  • 2
  • 8
1
vote
1 answer

No class located error in Matlab while calling java class

I have developed an Matlab code for stegnography which requires some preprocessing to be done by a Java file. The java file aes1.java contains the function encrypt(String s) which needs to be called by matlab…
1
vote
1 answer

Using static function in CI

I have a function like below, there is a block of code for each branch in conditional statement, I'd like to be able to just call that block of code once and then refer to it via an array, but I am a little confused how to do this. The function…
the tao
  • 253
  • 2
  • 6
  • 13
1
vote
1 answer

using static function vs member function on object creation or updating

From time to time I am facing with this issue and could not come up with final decision. For example I have a User class. Is there any "recommended" way to create this object in database? For example; User user = new User(); user.name =…
Teoman shipahi
  • 47,454
  • 15
  • 134
  • 158
1
vote
0 answers

Does unused static functions in headers, increase the kernel module size?

Static functions are functions that are only visible to other functions in the same file (below link). static function in C While developing a loadable kernel module, I should include many headers. These headers implement too many static functions…
Amir Saniyan
  • 13,014
  • 20
  • 92
  • 137
1
vote
1 answer

Static function access to class member

Class Header: #ifndef _APP_H_ #define _APP_H_ #include "glut.h" #include "Declare.h" class App { private: static float angle; public: App(); int OnExecute(); void OnLoop(); static void OnRender(); bool OnInit(); …
Chemistpp
  • 2,006
  • 2
  • 28
  • 48
1
vote
1 answer

Scope of Namespace

I'm a C developer and just recently switch to C++ so namespace is new thing to learn. The A class has a static method validate(), thus it can only access static variables or constants of the A class. But if the A.cpp has a constant defined in a…
XtremeCold
  • 27
  • 1
  • 6
1
vote
0 answers

Static variable change does not take effect, nodeJS

I'm writing a little nodeJS based email server. I have a Request object, and in it there's one static variable that stores all the users and is defined like so: Request.publicMemory = new Object(); Request.publicMemory.users = new…
Yotam
  • 9,789
  • 13
  • 47
  • 68
0
votes
3 answers

Return an object with an update data, that is pass in to a public static function

How can I return an object with an update data, that is pass in to a public static function? GetDate.dayName(MyDate.setDate(1984,3)) //MyDate with new info (year, month) will be pass into GetDate.dayName package hwang.time { public class…
Hwang
  • 502
  • 1
  • 12
  • 32
0
votes
1 answer

What's the difference between static non-member functions and non-static non-member functions?

What's the difference between these two non-member functions ? static void function1() { std::cout << "Test" << std::endl; } void function2() { std::cout << "Test" << std::endl; } EDIT : I know static means that the function has internal…
Tesla123
  • 319
  • 1
  • 7
0
votes
1 answer

.NET 4.0 in C++ - How call AppendText for RichTextBox from a static member function

My mind somehow is stuck in a "loop of errors". I don't want to waste time any more with endless trial and error, so I better ask here: I have a Windows-Form (.NET, C++) like following. The simplified version here only has a RichTextBox, a static…
EliteTUM
  • 705
  • 2
  • 8
  • 21
0
votes
3 answers

NSClassFromString(MyClassName) than calling class function of MyClass

i got a UIViewCustom Class with 7 childs. each of the childs got their own class functions for helping initiating +(int) minHeight; +(int) minWidth; in a UITableView i select one of the classes and the function…
Seega
  • 3,001
  • 2
  • 34
  • 48
0
votes
2 answers

Why are these static functions working outside their file?

I defined the next two static functions in a file named Grafico.h. static inline interface_t * obtener_intf_por_nombre(nodo_t *nodo, char *nombre_if) { for (int i = 0; i < MAX_INTF_POR_NODO; ++i) { if(!nodo->intf[i]) return NULL; …
EmTor
  • 107
  • 9
0
votes
1 answer

Importing static Functions In Modularized C++ Projects

There are many functions in CRT library marked as static. How it will be imported in modularized project? Here is the code reproducing the problem. Header.h static auto foo() -> void {} ConsoleApplication5.cpp import "Header.h"; int main() { …
Serge Kork
  • 61
  • 3
0
votes
1 answer

Angular 7 How To Access Domsanitizer Object inside a static function

I am trying to resolve the checkmarx issue which says application embeds untrusted data in the generated output.This untrusted data is embedded straight into the output without proper sanitization or encoding, enabling an attacker to inject…
1 2 3
8 9