36 Topics

Member Avatar for
Member Avatar for Michael_9

# **OLD** # [URL=http://s127.photobucket.com/user/yoda3ddd/media/codemap_zps4115ff7e.jpg.html][IMG]http://i127.photobucket.com/albums/p158/yoda3ddd/codemap_zps4115ff7e.jpg[/IMG][/URL] The Data Namespace Core Friend Module Func Public OkButton As Button Public CancelButton As Button Public ProgBar As ProgressBar Private Sub ProgressLoop() Do Func.ProgBar.PerformStep() Threading.Thread.Sleep(1) Loop End Sub #Region "Constants" Public Const DataRoot As String = "C:\AFormData\" Public Const IMG_PATH As String = "C:\AFormData\img" Public Const …

Member Avatar for Michael_9
0
473
Member Avatar for ddanbe

I recently came accross this code: Mat3D R_z(double RotAngle) { const double S = sin (RotAngle); const double C = cos (RotAngle); Mat3D U; U.m_Mat[0][0] = +C; U.m_Mat[0][1] = +S; U.m_Mat[0][2] = 0.0; U.m_Mat[1][0] = -S; U.m_Mat[1][1] = +C; U.m_Mat[1][2] = 0.0; U.m_Mat[2][0] = 0.0; U.m_Mat[2][1] = 0.0; U.m_Mat[2][2] = …

Member Avatar for ipswitch
0
435
Member Avatar for it@61@sec

Does C++ have predefined text constants / string constant to be used as replacements for digits when testing errorcodes ? An example: if (errcode == 17){ std::cout << "The file already exists!" << std::endl; } To make it more readable I can write: if (errcode == FILE_ALREADY_EXISTS){ std::cout << "File …

Member Avatar for vijayan121
0
214
Member Avatar for kent.johnstone_1
Member Avatar for Labdabeta

I need to know which of these three copies of code is considered best. I also need to which one is more efficient memory wise and which is more efficient time wise. Thanks: enums [CODE]enum MyEnum{EnumTypeOne=1,EnumTypeTwo=2,EnumTypeThree=4,EnumTypeFour=8};[/CODE] macros [CODE]#define EnumTypeOne 1 #define EnumTypeTwo 2 #define EnumTypeThree 4 #define EnumTypeFour 8 typedef …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for priyanka.choudhary.90038

Hi, I do have doubt regarding const declaration in copy constructor. Can anyone let me know why do we need const reference in copy constructor, as we already know reference itself is const pointer.So why we should use const as a prefix in copy constructor. Regards, Mohan

Member Avatar for deceptikon
0
1K
Member Avatar for ddanbe

The luxuries we now have in the amount of pixels on a screen to draw some amazing graphs with, were lacking in the early days of computing. Most of the time you had to resort to rude printed output. It wasn’t that bad always. Sometimes it was and still is …

Member Avatar for ddanbe
1
3K
Member Avatar for lloydsbackyard

i have this code so to hinder from access when the url is directly type i understand BASEPATH is a constant but can anyone give me idea on how to cofigure the basepath? do i need to create a constant folder and constant php file? if (! defined('BASEPATH')) exit('No direct …

Member Avatar for almostbob
0
185
Member Avatar for UKnod

I have a warning that I can;t get rid of: Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated. I am pretty sure it is becasue I have not dimentioned the variable but how do you dimention an IO.memorystream. …

Member Avatar for UKnod
0
277
Member Avatar for James19142

I need to modify an object in a QVector. I'm the `[]` operator to point to the object, which is overloaded with a constant and a non-constant version. The problem I'm having is that I don't know how to specify the non-const version, so I get compile errors telling me …

Member Avatar for James19142
0
207
Member Avatar for vikuseth

#include <iostream> class Hello { public: void Test() { std::cout << "Testing" << std::endl; } }; class Hi { public: Hi() :hello(new Hello()) {} ~Hi() { delete hello; } void Testing() const { hello->Test(); } private: Hello * hello; }; int main(int argc, char ** argv) { Hi hi; ; …

Member Avatar for vikuseth
0
274
Member Avatar for vikuseth

double & val = 66.6; //illegal const double & val = 66.6; //legal I was just doing some demo programs and came through the above concept but not able to identify what exactly the need of the above concept . what magic exactly const is doing in the second case …

Member Avatar for Gonbe
0
217
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 sandorlev

I have started writing a *really* basic tile engine in C++ and I'm not entirely sure when to use const return values. Should I use them in cases like this class A { private: Rectangle hitBox; public: A(); const bool Collision(const Rectangle& hitBox2); }; or is it totally pointless?

Member Avatar for mrnutty
0
241
Member Avatar for Tsaou

Hi, recently i started taking lessons on c programming and my first assignment was to make programm which would name all the perfect multiperfect or superperfect numbers within a set (whose limits will be given as #define constants) and their percentage. Anyway apart from any logic errors (which i would …

Member Avatar for Gonbe
0
302
Member Avatar for sbrohee

Dear all, I am certainly not an expert in C++ development but after some time, I had some code running and compiling for a bio-informatics tool. As always in Science, I changed my area of research of a while and when I came back to my tool, I had changed …

Member Avatar for sbrohee
0
2K
Member Avatar for laetitia--

Hello, I am newb with php I got a strange message error, that is: [U]Notice: Use of undefined constant y - assumed 'y' in /home/www/healthforum.uib.no/htdocs/ohcsurvey/survey/sp1.php on line 139 [/U] I am making a survey where the user , by cliking radio buttons, can choose between yes or no to a …

Member Avatar for ryantroop
0
1K
Member Avatar for manishanibhwani

can anyone tell me whether we can use const variables for case ...eg I wrote the following code: const int i=2; int j=0; switch(1) { case i:printf("hii"); } now ...this snippet is running properly in turbo c but not in dev cpp... likewise if we use this const variable as …

Member Avatar for deceptikon
0
186
Member Avatar for cse.avinash

I am doing following code to get the output upto 5 decimal characters of any number inputted by user when divided by 1, I have to use typecast it with (float) , can any one tell me how this can be done without typecasting or using float constant.. int main() …

Member Avatar for cse.avinash
1
177
Member Avatar for johndmingione

I'm having some trouble defining constants correctly. I know the format should be this: Const CONSTANT_NAME [As ConstantType] = value But I'm a little unclear of how to word it. So here is the Line I need to change into a Constant. Normally I would have a BAS file do …

Member Avatar for AndreRet
0
241
Member Avatar for 3nrichedd

Hello, I created this little asci art in java, and am wondering how to implement a constant int value that can be changed to make the picture bigger/smaller etc.. these are my loops: [CODE] for(int i = 5;i>=0;i--){ for(int j = 1;j<=i;j++){ System.out.print("P"); } for(int j = 5;j>=i;j--){ System.out.print(" "); …

Member Avatar for stultuske
0
350
Member Avatar for bennetk2

I can't figure out what this error is saying. Error: C:\Users\Kyle\School\CS 372\Statistician\Statistician.cpp||In function 'bool operator==(const statistic&, const statistic&)':| C:\Users\Kyle\School\CS 372\Statistician\Statistician.cpp|225|error: passing 'const statistic' as 'this' argument of 'float statistic::sum()' discards qualifiers| C:\Users\Kyle\School\CS 372\Statistician\Statistician.cpp|225|error: passing 'const statistic' as 'this' argument of 'float statistic::sum()' discards qualifiers| C:\Users\Kyle\School\CS 372\Statistician\Statistician.cpp|226|error: passing 'const statistic' as …

Member Avatar for gusano79
0
332
Member Avatar for engineerchica

Hey everyone, I am working on a function that reads a text file (portion below) of data points arranged in two columns and stores the numbers only in an array of signal[2500][2]. The problem is, I need to do some search and replace on [I]some[/I] of the data points. Some …

Member Avatar for WaltP
0
220
Member Avatar for yye

Hi, I want to declare an array of constant values in my header file, and this array cannot be changed in the main code. const uchar x[4] = {1, 2, 3, 4} does not work, cos the linker will complain that the address space overflow. Is there any way to …

Member Avatar for Moschops
0
339
Member Avatar for VengefulToast

Hi members, just a simple question, how would I show a constant in an UML diagram? For example, here is a double field the class contains. - radius : double But how would the constant PI (3.14159...) be shown? - PI : constant?? Future thanks for the responses!

Member Avatar for niranga
0
905
Member Avatar for WrMadison667

Okay, so I'm new to C++ programming and am working on a simplified project to find Expected taxable income. The project states that I have to set SI, HH, MJ, and MS as const int variables equal respectively to 5700, 8350 11400, and 5700. const int SI = 5700; const …

Member Avatar for Fbody
0
139
Member Avatar for falconmick

I promice everone that I have looked and looked and looked for a solution, I'm not just having a problem and being lazy putting it on daniweb... haha :) ull have to trust me, ive even googled it :O! Ok, so I am wondering, if I wanted to return a …

Member Avatar for falconmick
0
237
Member Avatar for Virangya

HI CONSTANTS in my customer site are affecting my admin site. i don't know why. also when i browse for admin site and if index.php file is not available home.php file loads. i find this very weird... can anyone please help me? following is some of the errors it generates. …

Member Avatar for diafol
0
390
Member Avatar for nocloud

I have a the following snippet of code [CODE]string const& symbol::at(int index) const { assert(index<symbol_data.vector::size()); return symbol_data.vector::at(index); }[/CODE] This does not compile successfully, instead, I get complaints about [CODE]error: ‘template<class _Tp, class _Alloc> class std::vector’ used without template parameters[/CODE] Now, I think this has something to do with the fact …

Member Avatar for mrnutty
0
324
Member Avatar for learningcpp

Hi All, Can you please help me to understand why the following code is behaving this way? I think both outputs should be 1 ( 1 means const T), but its not!! [CODE] template <typename T> struct IsConst{ enum {isConst = 0}; }; template <typename T> struct IsConst<const T>{ enum …

Member Avatar for learningcpp
1
3K

The End.