so i've been working on a website on and off for about a year now, and i'm finally at a point where it's functional enough to test out in a sort of private beta (not ready for live release). but i never thought about the correct process for doing this and what things i need to take care of. i've never released a public website before. ...
Possible Duplicates:
When to use new and when not to, in C++?
When should I use the new keyword in C++?
It seems like I could program something without ever using the word new, and I would never have to worry about deleting anything either, so why should I ever call it?
From what I understand, it's because I would run out o...
Here's the problem, which only occurs in Internet Explorer (IE). I have a page that has links to several different types of files. Links from these files execute a Javascript function that opens a new window and loads the specific file. This works great, unless the file I need to open in the new window is a PDF in which case the windo...
I was trying to look at the behavior of the new allocator and why it doesn't place data contiguously.
My code:
struct ci {
char c;
int i;
}
template <typename T>
void memTest()
{
T * pLast = new T();
for(int i = 0; i < 20; ++i) {
T * pNew = new T();
cout << (pNew - pLast) << " ";
pLast = pNe...
Is this the right way to use delete[] operator?
int* a=new int[size];
delete[] a;
If yes, Who (compiler or GC or whoever) will determine the size of the newly created array? and where will it store the array size?
Thanks
...
I am transitioning to C++ from C. In C++, is there any use for the malloc function? Or can I just declare it with the "new" keyword. For example:
class Node
{
...
}
...
Node *node1 = malloc(sizeof(Node)); //malloc
Node *node2 = new Node; //new
Which one should I use?
...
I've been trying to figure this out for hours now, and I'm at my wit's end. I would surely appreciate it if someone could tell me when I'm doing wrong.
I have written a simple class to emulate basic functionality of strings. The class's members include a character pointer data (which points to a dynamically created char array) and an ...
Hi,
According to this reference entry for operator new
( http://www.cplusplus.com/reference/std/new/operator%20new/ ) :
Global dynamic storage operator
functions are special in the standard
library:
All three versions of operator new are declared in the global namespace,
not in the std namespace.
The first and second...
Hi All
Is there a way, and how would I go about implementing my own keyword such as in, and as (etc), to be used in my code?
Here is what I had in mind. I want to (just for my own personal reasons, I guess) add a few keywords of my own, one of which would be the "was" keyword:
if(Control was Clicked)
{
// etc etc
}
...
Hi guys, I haven't coded in C++ in ages. And recently, I'm trying to work on something
involving structs. Like this
typedef struct{
int x;
int y;
} Point;
Then in a loop, I'm trying to create new structs and put pointers to them them in a list.
Point* p;
int i, j;
while (condition){
// compute values for i and j with som...
In order to achieve this effect, I would like to know how I can make the WebBrowser to scroll up when new content is added to the HTML page?
"Allow more entries to be displayed in the view: When the user clicks more, additional entries should be displayed in addition to the ones which are already displayed. The code should cause the U...
Hi All
I am not worried about whether this is in Winforms or WPF.
Is there ANY way at all that I could develop my own user control like the one found in Microsoft Paint, below:
If you can't see the pic above, it's here: http://img232.imageshack.us/i/txtboxlblctrl.png/
Is there anyway at all I can do something like this in C#?
Thank...
Or it's the same in c/c++?
...
Hey there, I'm writing a template container class and for the past few hours have been trying to allocate new memory for extra data that comes into the container (...hit a brick wall..:| )
template <typename T>
void Container<T>::insert(T item, int index){
if ( index < 0){
cout<<"Invalid location to insert " << index << endl...
Okay, so I'm trying to override a function in a parent class, and getting some errors. here's a test case
#include <iostream>
using namespace std;
class A{
public:
int aba;
void printAba();
};
class B: public A{
public:
void printAba() new;
};
void A::printAba(){
cout << "aba1" << endl;
}
void B::printAba() new{...
Hi to All,
I developed an iPhone app which displays iPhone AddressBook contacts list.
I want to add extra fields to the selected contact.
Using AddressBook framework,it was not possible.So,i want to attach those values to the "contacts" table of my database.
How can i insert those existing contacts into sqlite table(contacts).
Pleas...
Hi
Could someone tell me how to add a new line in a text that i enter in a mySql table.
I tried using the '\n in the line i entered with INSERT INTO statement but '\n is shown as it is.
Actually i have created a table in Ms Access with some data. Ms Access adds new line with '\n. I am converting Ms Access table data into mySql . But ...
In the following code, the call to myChild.bar() results in an exception because myChild is null. myParent is a valid object. What I don't understand is why myChild has not been created yet.
I have read the following document related to object creation sequence, but I am unsure how "new" is related:
http://livedocs.adobe.com/flex/3/html...
I was wondering if anyone knew of a way to mimic the ".show();" method silverlight 4?
Basically I have a form that includes a button. When that button is clicked, I would like the program to bring up another form that I have created. So essentially, in Page1.cs I have:
private void btn_Button1_Click(object sender, RoutedEventArgs e)
...
Hello,
I am trying to add a new contact to my contact list using the new ContactContract API via my application. I have the following method based on the Contact Manager example on android dev.
private static void addContactCore(Context context, String accountType, String accountName, String name, String phoneNumber, int phoneType...