From some other code i am calling some function in c# through windows service. That function is going to delete some unwanted data from sql server database. if i wanted i initiate the request it will take 30 min to delete the data.
in this 30 min time i am unable to access other pages in my website. is there any better way to design this?
Are there any situations to explicitly use the scope resolution operator with global scope? I can imagine a situation like:
#include <cmath> class IntWrapper{ public: IntWrapper& pow(char); IntWrapper(char); private: int m_int;
[Code] ....
But then I would think that the writer should have used a different name, and that using the scope resolution operator in the constructor body is still pointless...
I dont know anything about filestreams. I want to record the files that the customer bought, total, cash and change.
Here's my code.
// Create a program that will initiate a purchasing system for registered agents in an agency. #include<iostream> #include<windows.h> #include<conio.h> #include<fstream> #include<string> using namespace std; void password();
I am running a little business on the side, any program I could use that will show me the balances of clients after withdrawals, deposits. For example, if i had a data file like this :
Code: e 5 Elden c 3 Felipe 55342.51415 e 3 Leonardo e 1 Yong
[Code] ....
Lines beginning with 'e' will have an integer employee ID and an employee name. Lines beginning with 'c' will have an integer customer ID, customer name, and a floating point account balance. Lines beginning with a 't' will have a customer ID, employee ID, a 'w' or 'd' representing withdrawal or deposit, and a floating point transaction amount.
Now, obviously the program doesn't have to be exactly like this but something along these lines.
I have done alot of googling for the scope resolution operator and Ive gained a bit of an understanding as to what it does i know it can distinguish between global and local variables, but I see it used to access methods/members of classes such as this example, why not just use a dot instead to access it?:
sql:: Driver *driver;
Why is the scope resolution operator being used here?
Code: vector<int>& function(int a , int b){ vector<int> s(3000000); vector<int> xxx(4); return xxx }
Not to board people with details but if i am returning the the reference to a vector xxx what happens to vector s. is it destroyed ?? it should be, but i don't see it on my memory map (memory is not released) . can this be or should i go and search for error on some other place.....
#include <iostream> #include "sushi.h" using namespace std; int main() { do { ......sushi go; ......string x; <----------------------------Declared x here ......cout << "wanna use a banana?" << endl;
[Code ....
Error reads: 'x' was not declared in this scope.
How do I fix this?
P.S The sushi class does not matter, that is all perfect. Also, the dots are to represent my tabbing to make it easier to understand.
For some reason my compiler says "rename not declared in this scope" .... Isn't it declared in iostream? Or is rename only for C not C++? And if it is only for C how do I rename a file in C++ then?
#include <iostream> #include <cstdlib> using namespace std; int main(int argc, char* argv[]){ char oldname[] = "RomeTW.exe";
Ran into something today that does not make sense:
This compiles: Code: int x = 5;
switch(x) { case 0: { int value = 5; } break;
[Code] ....
Ok so it doesn't like int value = 6 b/c of int value = 5 for case 0. However since the value in case 0 is declared within the brackets one would think it has case scope.
So I tried this:
Code: int x = 5; switch(x) { case 0: { int value = 5; } break;
[Code] ....
Now it doesn't like it b/c value has not been declared in case 1:. These two conditions cannot possibly be both true at the same time. You cannot disallow the declaration of value in case 1 b/c it interferes with value in case 0 and at the same time disallow me to use value from case 0 b/c it is not in scope. If it was not in scope then theoretically I should be able to declare value in case 1.
Both MSVS 2012 and 2013 exhibit the same behavior. I checked the standard and it is unclear on the matter.
I have observed that inline functions can not be prototyped. example:
.cpp file:
inline void whatever() { cout<< "this is inline"<< endl; }
.h file, prototype inline void whatever(); //would ask for a definition
Because of this, I have have just made functions that are used in only 1 .cpp file (ever) inlined, to make it more efficient (and it has demonstrated that it is more efficient). It's worked out fine so far, but what about the scope of the definition??
Since an inline function is like a templated function, in that it can't be prototyped, how are name conflicts resolved, and what is the best practice for writing inline functions??
Example of a conflict:
//in some arbitrary header... void do_somthing(); //in .cpp file that inlcudes the header... inline void do_somthing() { cout<< "I'm doing somthing!!"<< endl; } int main() { do_somthing(); //which one?? it compiles fine though!! return 0; }
I'm working through this neural network tutorial, unfortunately I get stuck trying to compile on line 28, saying "error: 'neuronNum' not declared in this scope." I seem to always get stuck on these kinds of errors, yet I don't understand because I though that the variable was declared and initialized within the for loop.
#include <iostream> #include <vector> using namespace std;
I'm trying to make a dynamic 2d array of a Tile Object I created, the Dynamic 2d array was working when I tested it as an int array but not that I gave it a type of Tile it is giving me the above error. I'm reading values from a .txt .
tile Tile; Tile **grid; grid = new Tile*[a]; for (int i = 0; i < a; ++i) { grid[i] = new Tile[b]; }
#include <iostream> #include <vector> #include <cmath> #include "ANN.h" using namespace std; const int NUM_HIDDEN_NEURONS = 3;
[Code] ....
So I am getting 2 errors. Here is both of them.
ANN.cpp: In member function "void ANN::JustDoIt()": ANN.cpp:36: error: "class std::vector<HiddenNeuron, std::allocator<HiddenNeuron> >" has no member named "SetWeights" ANN.cpp: In member function "void ANN::SetData(double, double)": ANN.cpp:85: error: "SetNeuronData" was not declared in this scope
class CObjects { int m_CurrentTime; int m_Steps; AStarList* OPEN; AStarList* CLOSED; std::vector<AStarNode *>solution;
[code]....
CCB is derived from CrowdEntity and in turn is derived from CObjects Inside CObjects, I declared AStarList *OPEN; Why would howmany become garbage (cdcdcdcd) when I reference it in GetBestNode()
1. Pointers can be used as pass by reference. When I dynamically allocated memory for array[50] in the run function, does that mean I am changing the size of the pArray in main as well? Or does the scope of array[50] ends with the function run? if so, should I do a delete [] Array inside the run function?
2. When I do delete[] pArray in main, what does it delete? memory for array[50]? or array[100]?
#include <iostream> using namespace std; void run(int* Array, int& s) { s = 50; Array = new int[s];