I am having issues with trying to implement JameM's kernel. I page fault attempting to assign the return value of place_ordered_array into the kheap.The malloc function should remain between 10000000-20000000 yet I exceed this. I have a hunch it's due that I am using grub2 (he uses legacy) and it loads modules at a higher address. I tested this by debugging at alloc and found that the function cannot handle above about 20000000. Am I on track to say I must attempt to move the module or code to prevent trampling or that I should switch to legacy.
Been trying to configure the GridView to display ony 4 rows of data at a time. I thought it wasn't working because I forgot to set AllowPaging to True, but after I did that, I just get the error of
The data source does not support server-side data paging.
Source Error: Line 66: titlesGridView.DataBind(); // displays query results
Here is my Books.aspx.cs code:
// Fig. 29.11: Books.aspx.cs // Code-behind file for the password-protected Books page. using System; using System.Data.Entity; using System.Linq; namespace Bug2Bug.ProtectedContent { public partial class Books : System.Web.UI.Page {
[Code] ....
Am I missing anything or doing something wrong thats not causing it to page & only display 4 titles at a time?
I am making a tictactoe program that requires me to have a 3 by 3 two dimensional array of integers, in which the constructor should initialize the empty board to all zeroes. The program complies, but it keeps outputting garbage values and i'm not entirely sure why, My print function isn't complete yet, since I want to print out the array in a tic tac toe format, but i'm more concerned with why it's printing garbage values, here is my code:
I am working on a homework assignment and have most of the program working, but when I try to compile it keeps telling me to initialize the coin variables in each class. However, they are supposed to be added then removed so I don't want to set them back to zero.
Rewrite the Purse program given in Page 35 with functions to perform insert and remove operations. The function insert (int p, int n, int d, int q) will initialize pennies, nickels, dimes and quarters. The function dollars() will return the dollars. The function remove (int p, int n, int d, int q) will subtract pennies, nickels, dimes and quarters. The function display() returns a new String to print the content of the purse with remaining pennies, nickels, dimes and quarters.
Code: usingnamespace std; int insert_money (int *p, int *n, int *d, int *q); int remove_money (int *p, int *n, int *d, int *q); int dollars(); int main()
enum Country {India, China, France, NumCountries}; // plus many other countries struct School {}; struct Mall {}; struct HockeyArena {};
[Code] ....
Output:
PersonFactory::initializeEthnicNames() called Carrying out the initialization... PersonFactory::initializeEthnicNames() called PersonFactory::initializeEthnicNames() called PersonFactory::initializeEthnicNames() called PersonFactory::initializeEthnicNames() called numberOfTimesInitialized = 1
As you can see, even though five PersonFactory objects were constructed, the ethnicNames initialization only occurred once, as desired. However, there are some issues with my method. First of all, the use of the comma operator is ugly in my opinion. But fashion statements aside, PersonFactory::initializeEthnicNames() is still called multiple times, which is not good, even though it correctly avoids reinitializing ethnicNames after the first call. Also, I now forever get the annoying compiler warnings that the bool namesInitialized is never used, which is true, thus wasting a small bit of memory. And finally, I cannot declare ethnicNames const now, and it is supposed to be const. Any better way to accomplish what I'm trying to do?
By the way, the reason why I don't initialize ethnic names outside the class as is normally done for static data members (and that would indeed allow me to declare it const) is because it would get messed up if I later change the order of the elements in enum Country. Hence actual lines of initializations I think are needed. And I do want ethnicSurnames inside PersonFactory, because I feel it really does belong there. Also, PersonFactory is not to be Singleton, because it has data members that depend on some parameters in its constructor (e.g. geographic location).
I want to know how to make variables during the program. for example in a program i want to have the player be able to create their own spells or add their own weapons to the game without having to edit the source code. i use sfml 2.0
I'm working on this program, and when i run it for 'p', 'P', or for a incorrect service code a error message pops up saying that "totalCost is being used without being initialized". I don't want to change it to switches, case, and breaks now because I've come too far to change it all. I have that variable right here just below.
#include <iomanip> #include <iostream> using namespace std; int main() { int acctCode; double nightCost; double totalCost;
So I'm writing a small program for class, and for some reason I keep getting an error when trying to initialize head to NULL. Even threw in the namespace just to see, nothin'.
#ifndef NUMBERLIST_H #define NUMBERLIST_H using namespace std;
[Code].....
There's my header file. Not sure what I'm doing wrong with the constructor.
EDIT: Got it to work with nullptr, but still curious why that isn't working
I am going to be using a boolean variable to mark whether or not a specific field has had data entered into it. I figure the best way to do that is to initialize all the elements of the structures to 0. However, with strings and with the nested structure, I'm not sure how to do this.
Here is a declaration of property class class CMyPropertyPage11 : public CPropertyPage
Here is the definition CMyPropertyPage11::CMyPropertyPage11() : CPropertyPage(CMyPropertyPage11::IDD)
I really do not understand the role of the CPropertyPage(CMyPropertyPage11::IDD)
But I need to derive CMyPropertyPage11 from another CPropertyPage, say CBasePropertyPage adn really need to know how to implement the CPropertyPage(CMyPropertyPage11::IDD) initialization again.
I'm wondering what is the "best" way to initialize a bitfield struct. I have this bitfield, defined as:
Code: struct S { unsigned int a : 1; unsigned int b : 1; };
If I'm "using" the bitfield, I can initialize it easily when declaring it, as so:
Code: int main() { S s = {0}; }
Now, the issue I'm facing is that I want to embed S inside another struct, which I'll name "outer". EG:
Code: struct Outer { S s; };
I'm wondering what the "best" way to have Outer initialize S is? I've seen a lot of people use the "union" approach:
Code: struct Outer { Outer() { u.all = 0; } union { unsigned char all; S s; } u; };
but:This adds an extra field depth (the union's u)Does bit hacking, in a way (is the bitfield as large as my field?) I'd have wanted to initialize the field in my constructor, as so:
Code: Outer::Outer() : s({0})
However, this would appear to be a C++11 feature only.
I have, however, "observed" that by simply "empty constructing" s, eg:
Code: Outer::Outer() : s(){} //Initialize s ? vs Outer::Outer(){}
Okay so inside my ArcherArmor.cpp, I'm trying to figure out why the map initializer list isn't working, but for some reason I keep getting "Error C2593: 'operator =' is ambiguous". Here is my code:
I also have a class which ArcherArmor is derived from, that has a struct called `Armor`, which I left out for simplicity. The main problem is that error! The only thing I can think of is that im initializing the map wrong.
I am trying to create a `std::map` from `std:: string` to a pointer to member function type. I'm initializing the `map` with an initializer list (braced). When I compile, I get a message from the compiler: No matching constructor for initialization.
Want to initialize a local one dimensional array. How can I do the same without a loop?
Found from some links that int iArrayValue[25]={0}; will initialize all the elements to ZERO. Is it? If yes then can we write below code to initialize the elements to a non-ZERO value?
int iArrayValue[25]={4};
Do we have some other way to initialize an array to a non-ZERO value? Memset can initialize the element to ZERO.
In one of my programs I have a 3x3 array of string that I use to display the outcome to rock, paper, scissors, and another 1x3 used for a number guessing game. I have the arrays declared in the header file as follows:
//Games.cpp string rpsOutcome[3][3] { //row 1 { "Both of you picked rock, you tied. Try again", "You picked rock, the computer picked paper, you lose",
[code]....
From what I've read, Im pretty sure thats how your supposed to initialize multidimensional arrays (using the nested braces), but when I build the project, I get the following error:
What I need to know is how I can pass an argument to the Book constructor so I can change the const data member Category (with cascading capacity if possible. I also posted some of my set functions for further comprehension.
class Book { friend void CompPrice(Book &,Book&); //friend function that has access to the member functions of this class //The arguments sent to it are by address, and of type the class Book, so that it can have access to its member functions private: //private data members
I tried this syntax in both VS 2010 & VS 2012 Express For Desktop, and I get the same error in both compilers:
compiler error: non-aggregates cannot be initialized with initializer list
To put the code above in context, I'm going to have a .txt file with hundreds of thousands of string arrays, in initializer list format, such as:
{"string","string","string","","",""},{"string","string","string","","",""},{"string","string","string","","",""}...and so on
The first 3 strings in each array will be non-zero in length, and the last 3 strings in each array will be empty, as shown above.
I want to be able to cut and paste the arrays right into the declaration, either with:
string arrayOfArrays[0][6] = {{"string","string","string","","",""},{"string","string","string","","",""},{"string","string","string","","",""}...and so on }; or vector<vector<string> > vecOfVectors = {{"string","string","string","","",""},{"string","string","string","","",""},{"string","string","string","","",""}...and so on };
I know I can do the first, but apparently the second declaration method with vectors won't work. I would like to work with vectors, but I'm not sure about the initialization. The .txt file will be what it is, so the initialization will have to be able to work with its 'array-like initializer' format.