Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

MessageBox is from the .NET framework and can ben called by any of the .NET languages. MsgBox is older VB only.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

"lay" can also be a past-tense of the very "to lie"

Actually, laid is the past tense of both lay and lie (link).

"Yesterday I was sick, so I laid in bed all day" is correct -> past-tense.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

They can install pirated Window XP into thier computer.

Wrong. Ending support does not end Microsoft's copyright (link).

it is alright or not to install pirated Windows XP

Not. You could potentially be sued by Microsoft, fined and/or jailed for theft.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Done. Next problem.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Maybe you need admin permissions to do that. Move the pdf file somewhere else such as c:\temp and see if the problem goes away.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

my assignment code is not commented (in hindsight that was a mistake) and I do not understand it anymore.

I can't tell you the number of times I've heard that same story.

Sorry, but I can't help you with your question.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Ah, that was the problem. Just went to Project -- Add Reference and selected System.Numerics.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

It reminds me of what happened with "New Coke". Anyone else remember that?

Yes, I remember it well, and what a big fiasco that was. Soon after that incident it became a classic case that is taught in college advertising courses.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Also, be sure to reference System.Numerics.dll in your project a

See my original post -- it doesn't likeImports System.Numerics

And as you can see from my second post .NET 4.5 is installed, which meets the requiremenet of 4.0 or higher.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Microsoft is not going to support 8.1 either if you install service updates manually.

This means that Windows 8.1 users - starting patch Tuesday in May 2014 and beyond - will require this update to be installed.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

And your question is?? Please post the code you have written.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Because Window 8 got longer lifecycle support than Window 7.

Where did you get that from?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I could have sworn that I've seen this posted in DaniWeb C++ forum

void foo(int n)
{
    int ay[n];
    ...
    ...
}

I'm reading "The C++ Porgramming Language, 4th edition", and on paragraph 4.3 he specifically states that "The number of elements in the array, the array bounds, must be a constant expression." Why the difference?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Both VS and Programs & Features of Control Panel say I have vesion 4.5

Microsoft Visual Studio Professional 2013
Version 12.0.21005.1 REL
Microsoft .NET Framework
Version 4.5.51641

Installed Version: Professional

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I'm using VS 2013. I want to use the system.numerics.biginteger structure but VS says there is no such namespace as system.numerics! According to MSDN there should be. What am I missing?

Imports System.IO
Imports System.Numerics '<<<< error
Module Module1

    Sub Main()
        Dim OneLightYearInches As BigInteger = 372469703661417000

    End Sub

End Module
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

In English only living breathing things have gender, inanimate objects and plants do not so they are referred to as "it". "Where is the table? It is moved. And the chair? It is just painted don't sit on it".

How do you determine what is called she and what is called he? How is a chair (he) different from the table (she) ? Or do you just learn the difference through education?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

According to this article, Microsoft will no longer issue security updates to Windows 8.1 if you don't install the update path.

Since Microsoft wants to ensure that customers benefit from the best support and servicing experience and to coordinate and simplify servicing across both Windows Server 2012 R2, Windows 8.1 RT and Windows 8.1, this update will be considered a new servicing/support baseline... beginning with the May Patch Tuesday, Windows 8.1 user's devices without the update installed will no longer receive security updates. This means that Windows 8.1 users - starting patch Tuesday in May 2014 and beyond - will require this update to be installed. If the Windows 8.1 Update is not installed, those newer updates will be considered "not applicable."

Is Microsoft attempting to drive away all it's customer base? Seems so.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I understand why the move constructor is called when a function returns a class, such as CreateA(), but why isn't the move constructor called when a class is passed by value to a function, such as foo(A a)? Aren't they the same?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

If you think Windows 8 is bad, try Win95, Win98 and WinMe. Those were some real horror stories.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

can I cast the return type of malloc (void *) to another type ( Struct Switch *)

You can cast the return value of malloc() to anything you want, but that doesn't make any sense to allocate memory for sizeof(struct Switch) then assign it to Vector*.

I thought of changing the function newVector.

Looks like that will work. Just make sure that data does not get desroyed outside of the Vector class. For example

int* data = malloc(sizeof(int)*10);
Vector* = newVector(data,1000);
free(data); // this will invalidate the pointer stored in Vector
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Is this the right way to call the newVector function for instance ?

No.

#include "Vector.h"


typedef struct tagSwitch
{
    int a, b;
} Switch;

int main(int argc, char* argv[])
{
    Switch* aSwitch = 0;
    Vector* NetRouters = newVector(aSwitch, sizeof(Switch*));
    return 0;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You have several syntax errors. Here are the corrections. Note that the return value of malloc() can't be typecase to something called data. In C language a typecase of void* return value is necessary (but it is in c++).

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include  "Vector.h"

void FatalError(const char* msg)
{
    puts(msg);
    exit(1);
}

//action of setting a new vector
Vector* newVector(void *data, unsigned long elemsize)
{
    Vector* pvec = (Vector*) malloc(sizeof(Vector)); //memory space set
    if (pvec == NULL)
        FatalError("Malloc failed.\n");
    memset(pvec, 0, sizeof(Vector));

    pvec->reserve = 1024;
    pvec->capelems = pvec->reserve;
    pvec->elemsize = elemsize;
    pvec->elems = 0;

    pvec->mem = malloc(pvec->capelems * pvec->elemsize); //pvec->elemsize is the sizeof(data)
    if (pvec->mem == NULL)
        FatalError("Vector Malloc failed.\n");
    memset(pvec->mem, 0, sizeof(pvec->capelems * pvec->elemsize));
    return pvec;
}

//action of deleting a vector
void deleteVector(Vector* pvec)
{
    free(pvec->mem);
    free(pvec);
}

//action of extending a vector size
void resizeVector(Vector* pvec, void* data, unsigned long capacity)
{
    pvec->capelems = capacity;
    void* mem = malloc((pvec->capelems + pvec->reserve) * pvec->elemsize);
    memcpy(mem, pvec->mem, pvec->elems * pvec->elemsize); //copy characters from memory
    free(pvec->mem);
    pvec->mem = mem;
    pvec->capelems += pvec->reserve;
}

//action of pushing back an element to a vector
//Adds a new element at the end of the vector, after its current
//last element.The content of val is copied (or moved) to the new element
void push_backVector(Vector* pvec, void* data, unsigned long elemsize)
{
    assert(elemsize == pvec->elemsize); //check certain conditions at run time
    if (pvec->elems == pvec->capelems)
    {
        resizeVector(pvec, data, pvec->capelems);
    }
    memcpy(pvec->mem + (pvec->elems * pvec->elemsize), data, pvec->elemsize);
    pvec->elems++;
} …
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I don't see all the fuss about that metro screen, if you don't like it then don't use it.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

i want a full code

Sorry, you are not going to get it. We don't do people's homework for them.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You need to have the input statements (lines 9,10) repeated at the end of the loop to get the next input from the user (insert after line 33).

The data is supposed to come from a file, not the keyboard.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

c++ language itself does not have an api for database access. As a beginner accessing any SQL compliant database is probably going to be very challenging. Before doing anything you need to study the SQL language so that you know how to request data and update the database. Without that knowledge you will get nowhere. There are plenty of online tutorials that will provide you with that info.

Here is a tutorial that will guide you through the process of using Micosoft Access database via ADO library.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

you need to replace lines 8 and 9 with code that opens and reads a text file. Do you know how to read files?

Also, delete line 2, there is no reason to include cstdlib

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

MS has changed 8.1 so it starts up on the desktop,

Mine doesn't. It still starts on the metro screen. [edit]Nevermind, I figured it out how to do that. Google is wonderful!

is the Windows 8/8.1 interface significantly better than Windows 7 o

IMO no, it's actually a little more difficult.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I recall when I was in grade school my English teacher told is to always use "his" when gender was not known. That, of course, before it became politically incorrect to consider the male world dominance. Nowdays I sometimes see "her" used alone when gender is unknown, which is really sort of funny because that has implied the pendulum as swung the other way.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

post the code you have tried so that we can help you. Nobody here is going to write the whole thing for you.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

But 'their' & 'his or her' are the same

I disagree. "their" implies more than one person. The sentence you last posted would be the most correct.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

storedValue on line 13 is an object of each instance of the class. Each instance of intCell has it's own copy of storedValue. The objects on lines 34 and 40 are two different instances of the class, so they will not have the same copy of storedValue. If that is what you want (all instances have the same copy of storedValue) then you need to make storedValue a static member of the class.

class IntCell
    {
          public:
            IntCell() {} // <<<<<<<<<<<<<<<<<<<<<
            int read() const;
            void write( int x );
          private:
           static int storedValue; // <<<<<<<<<
    };

That will make storedValue just like any other global variable, so you will need to declare it as a global. Notice that you have to remove the initialization from the constructor so that the constructor doesn't destroy the current value when a new instance of the class is instatiated.

Somewhere near the beginning of the *.cpp file put this line:

int IntCell::storedValue = 0;

smitsky commented: Excellent advice as always! +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Dr Who is one of the longest running tv shows in history -- it's been running for over 50 years now. I used to watch it religiously every chance I could, but almost stopped with the new series started. The new Doctors seem just too young for the part.

Faulty Towers, I loved that show, only lasted 12 epesodes (2 seasons).

My two favorite American shows were Dallas and Law and Order SUV. Most new american tv shows suck, such as Modern Family, which would never have been shown 5 years ago before gay and lesbian marraiage was legalized here. Maybe it's just that I'm too old for those shows. Give me The Jeffersons and Archy Bunker anytime. I grew up with Cid Ceaser, Jack Benny, Jacky Gleeson, Lucy Ball, Bob Hope and many many other excellent commedians. They new how to make people laugh without uggering so much as one profane word. Too bad their kind of commedy is lost today.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Just seen on Facebook: "Giving someone a ticket for texting could save their life". That sentence is just soooo wrong.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

boost will be the most portable between MS-Windows, *nix and MAC. I'm not familar with the other two.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

First, highlight the text you want to quote and press Ctrl+C (copy to clipboard)

Next, in your post where you want the text to appear first insert > character then press Ctrl+V (paste from clipboard)

Here are some links where you can find good coding style guides. There is no one-way to code so select what you find useful to you.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Yes you're right. My first few attempts I couldn't even get a Hello World program to work!

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Moschops already explained the error message over 8 hours ago. Either you failed to read it or didn't understand it. You have to have a function called main() in your program.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

One situation is when accessing arrays of integers. This is just a very simple example.

int array[10] = {1,2,3,4,5,6,7,8,9,10};

int* p = array;
int i;
for(i = 0; i < 10; i++)
{
   *p += i;
   p++;
 }
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The second isn't being increased by 4 bytes from the ptr.

Yes it is. 945c + 4 = 9460 (5c+1=5d, 5d+1=5e, 5e+1=5f, 5f+1=60)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Your indent style is needing big improvement.

I'd hate to see his 1,000 line long program :)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

One reason not to upgrade to Windows 8 is because a few programs that run ok on win 7 won't run on win 8, such as M$ Office 2010. I tried for over a week to get office 2010 to work on win 8 and every attempt failed. Finally bought office 365.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The way I understand it your move constructor is not correct. The intent of the move constructure is to move data objects from one class to another, not to mearly assign a value to the current class. See this article for full explanation.

Here is another good article from StackOverflow

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You might have that problem if the library was built a C code and your program is attempting to call it's functions as C++ code. If that is the case then you need to tell the compiler that the library is C and not C++.

#ifdef __cplusplus
extern "C" {
#endif
#include "dhnetsdk.h"
#ifdef __cplusplus
}
#endif
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Great day :) Got up to 86F (30C), so I turned on the air conditioning a few minutes ago.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Test it and find out whether it is right or not, that's how all software programming works.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

by shift do you mean capital letters? if not, then I don't know what you mean by that.

If you must use typedef, then this is how to do it: for more info on typedef read this article.

#include <string.h>

int main()
{
    typedef char alphabet[27];
    alphabet alpha;
    strcpy(alpha, "abcdefghijklmnopqrstuvwxyz");

}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

in this case the this pointer is optional -- I like to add it so that it is very clear that savingBalance is a member of the class and not some other kind of variable.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

It's just a simple inline method, or you can put the implementation code in the *.cpp file if you wish.

class SavingsAccount
{
public:
    friend ofstream& operator<<(ofstream& out, SavingsAccount& obj);
    friend istream& operator>>(istream& cin, SavingsAccount& obj);
public:
    string firstName;
    string lastName;
    float savingBalance;
    float annualInterestRate;
    int objectnumber;
    void operator+=(int val) // <<<<<<<<<<<<<<<<<<<<<<<
    {
        this->savingBalance += val;
    };
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

remove the word typedef. I hope you realize that will create a non-null-terminated array of characters. You can't pass it to any of the functions in string.h.

A better and easier way to declare it is like this:

char alphabet[] = "abcdefghijklmnopqrstuvwxyz";