Eagletalon 34 Junior Poster in Training

To re-itterate: TRY FIRST!, dont give us your assignment and expect coding back... this is not a free software house, people get paid to do that...

so untill you can give us an example of your coding or actual problems that you are struggling with in it we WONT effectively help you

Eagletalon 34 Junior Poster in Training

values into a 2 dimentional array... output the arrays value by value, array by array

Eagletalon 34 Junior Poster in Training

Mandrew I think we are talking past each other...

What I am saying:

void class::a(){

    int MyInt = 5;

    b(MyInt);

    //MyInt = 6
}

void class::b(int* MyIntPointer){

    MyIntPointer++;
}

What you are saying:

void class::a(){

    int* MyInt = 5;

    b(MyInt);

    //MyInt = 5
}

void class::b(int MyIntPointer){

    MyIntPointer++;
}

See http://www.cprogramming.com/tutorial/lesson6.html

Eagletalon 34 Junior Poster in Training

Ok... Basics of Daniweb... TRY FIRST!, dont give us your assignment and expect coding back... this is not a free software house, people get paid to do that...

so untill you can give us an example of your coding or actual problems that you are struggling with in it, the best we can give you is:

Accept the month. - (input from user)
Accept the name of each staff. (Assume that there are only 5 marketing staffs) - (input from user)
Accept the number of student enrolled weekly for each staff. - (input from user)
Calculate the weekly sales for each staff. (Assume the fees for each student is RM 3000) - (calculation based on the input)
Display the monthly sales in a table. (see Figure 1) - (calculation based on input and special output)
Display the name and sales for the staff that is having highest sales. - (itterated comparison and display)
Display the name and sales for the staff that is having the lowest sales. - (itterated comparison and display)
Display the total sales of the month. - (calculation and display)

Also how the hell are we supposed to see Figure 1?

Eagletalon 34 Junior Poster in Training

cant think of an allready existing function... but if you have multiple arrays, use a bubble sort and apply the swop you are doing to both arrays instead of just one?

Eagletalon 34 Junior Poster in Training

When you pass by value, you "create" a second instance of the variable, local only to the function receiving it...

When you pass by pointer/reference you can see it as passing a big neon arrow pointing to the original variable...

thus you can imagine, as no additional memory is allocated or the value is not duplicated, it is much more efficient to pass a pointer/reference rather than by value, however this would mean that the function called would be able to change the value of the variable and have that change reflected back to the original...

To avoid this you could create a new variable in the function containing the value of the pointer passed, but then you are doing exactly the same as passing by value

alternatively... passing

"const int* MyInt"

would pass a pointer and make it constant (not changable)

Eagletalon 34 Junior Poster in Training

Start at the data, research what you have available and what you need and how to get that in your application...

Then you create an application which pulls in the data (saved externally as specified) and is able to display it, and also is able to enter new data, that would get you more than half way there, now you just need to follow the specs one by one...

Eagletalon 34 Junior Poster in Training

"add 1/3 to itself a large number of times and to compare the result to multiplying 1/3 by the number of times 1/3 was added to itself" & "Your program will do these additions 109 (1 billion) times." (perhaps they meant to say 10 x 9?)

so what I understand is this:

double Start = (1/3);
double Addition = (1/3);

double Multiplication = Start * (10 * 9);

for (long i = 0; i < (10 * 9); i++){

    Start = Start + Addition;
}

//compare Start to Multiplication
Eagletalon 34 Junior Poster in Training

cool man... give it a try, see how it goes, and if you manage just remember to mark the thread as solved

Eagletalon 34 Junior Poster in Training

OK OK OK, here is an example of what Suzie said you need to do, you do it yourself...

cout << "In which year where you born? (Example: 1995) ";
cin >> bjaar;
while <check if bjaar is not an integer>{

    cout << "Your entry was not a number, please correct it";
    cin >> bjaar;
}

now what you really need to do is drop the attitude, accept the input of people who YOU acknowledge know more than you (else you would not post in this forum) and start working to better yourself rather than attempt to convince others your then best

No one knows everything and most of what we do have some kind of flaw, but learning and developping our skills is what we call "GROWING UP"

you are considered a troll when you steal time of those who do not have it and are actually out of decency attempting to assist those who need it...

Eagletalon 34 Junior Poster in Training

uhm... WaltP, point 4 on your list is not "main" but "menu"... and I believe it can be void...

and the semicolon in point 3 is an end while the rest should just be spaced into a new line as an variable of the struct (I hope I said it right)

Ron Walt is correct on his points though he seems very irritated and quick to show out problems, thats the general coder way, try making your code easier to read and please dont be afraid of open lines and indentation... eg:

struct BuyerInfo
{
    int id;
    string fn;
    string mn;
    string ln;
    string ad;
};

BuyerInfo info;

and now, see BuyerInfo as a "datatype"... info as a variable of that type...

how would you create an array of 100 integers? apply the same

Eagletalon 34 Junior Poster in Training
SELECT DATEADD(DAY, 32143, CONVERT(DATE, '1899/12/31', 111)) -- RESULT = 1988-01-02
Eagletalon 34 Junior Poster in Training

I think he got confused between the Get method vs Set method...

also that specific error arises because you are trying to send to the function a variable in the main function but that variable is not declared or created in the main.cpp

Walt your posts can stand on their own but for a complete noob he wont understand a word, I know you are getting frustrated and trying to get the people to brush up on the basics, but I dont believe they will know where to brush up on if you dont give a reference,

that said, giving them code that explains everything also isnt the way to do it

WaltP commented: Yuo need to keep your *assumptions* about peoples mental states out of your posts. You on the edge of a Rules Infraction. -3
Eagletalon 34 Junior Poster in Training

I agree... its a decent way to check the outcome of your functions... alternatively you can use a try catch... but it comes down to the same

Eagletalon 34 Junior Poster in Training

Well I guess you could write an entire other program for the editing (which you can open from your main game with a call)

as for the file I think the best bet would be to save to a text file or some kind of encoding thereof... save the co-ordinates of everything and the links between them...

I take it your app will start with some kind of menu? start, load, options, exit etc...

if that is the case also save the name of the text file with an easy-to-read alias in another file (custom levels) or whatever and then access the specified file when requested...

You can then also create the levels you created in the same way and save in a different location or whatever...

In all truth its completely your porogative Im just giving my opinions of how I would do it... you can test alternatives for efficiency and ease of use...

Eagletalon 34 Junior Poster in Training

Well what compiler and libraries are available to you? what are you using too create a UI? OpenGL? DirectX? Qt?

Are you Using Visual C++? Dev C++? a little info goes a long way :)

Eagletalon 34 Junior Poster in Training

Hi everyone... I have found the cause...

In my constructer of the structs I called a function "disableMetaObject" which did not allow any of the Qt signals to be sent... and then my QAxObject wanted to load a void QVariant into a QString

so in short... dont call "disableMetaObject" when working with signals and catching QAxBase::exception signals...

Eagletalon 34 Junior Poster in Training

well I dont know much of this kind of coding... but I guess the best trick would be to first get the positions of each node? have that saved and be able to calculate the distance between each node?

then you can start with the current node... the node you want to go to... and compare the combinations of lengths applicable until you get the shortest one...

but without more info I wont be able to say...

Eagletalon 34 Junior Poster in Training

Hi there everyone...

Allright my setting is this:

I have written an C++ application that receives input from a user app, converts it to XML, and then posts it to our ERP (Syspro) through e.net COM objects using ActiveQt and in specific QAxObject...

The problem is this:

QAxObject inherits from QAxbase, which has the following signal according to its documentation:

void QAxBase::exception ( int code, const QString & source, const QString & desc, const QString & help ) [signal]

This signal is emitted when the COM object throws an exception while called using the OLE automation interface IDispatch. code, source, desc and help provide information about the exception as provided by the COM server and can be used to provide useful feedback to the end user. help includes the help file, and the help context ID in brackets, e.g. "filename [id]".

Very nice and all... now I have a few structs, each accessing a different COM Object and having different commands, but when I generate an exception (deliberately at present) in attempt to cause that signal to be emitted I immediately get the app crash and message "Access Violation Reading Location"

Here follow the specified coding blocks that should be accessed:

Header file:

Structs:

typedef struct Transaction_Struct{

    Transaction_Struct(XmlParserCLS* XmlCreatorMaster, LogWriter * LogsWriterMaster);                   //Constructor
    ~Transaction_Struct();

    XmlParserCLS* XmlCreator;                                           //Pointer to the XMLParserCLS

    LogWriter * LogsWriter;

    QAxObject* Transaction;                                             //QAxObject Pointer to the COM Object

    QDomDocument post           (QMap<QString, QString>& VariableMap);   //Transaction Post call and handling
    QDomDocument build          (QMap<QString, QString>& VariableMap);   //Transaction Build call …
Eagletalon 34 Junior Poster in Training

Managed it with timers... thnx in any case :)

Eagletalon 34 Junior Poster in Training

I believe I have traced the problem to a "Sleep(500)" call in the waiting between status check to the database... is there any alternative or way around this I can implement?

Eagletalon 34 Junior Poster in Training

Hey Everybody,

Allright my setting is like this:

I created a derived MVC program using C++ and QT on Visual Studio 2008, that sends multiple instructions to our ERP system through an external program...

On each command posted this way the user application needs to wait for a return string and react accordingly, this all happens in SQL with a continuos... query that takes place every 500 miliseconds with a timeout after x tries

Because of the large number of automation and lack of "communication" with the user I have included a "QProgressBar" in a dialog which gets updated as the functionality flows

The problem:

During these database queries while the application is waiting for a response my Progressbar animation is extremely laggy... the end aim is to convert to IPC and I believe this will solve it... but users have a tendency to want everything perfect (as you would all know)

Is there a way to either disable the animation in Win7 or a way to run the animation "outside the application scope" so it wont be influenced by the application database queries

Low priority but I cant really find references to this on google that are helpful

any specific coding required I will gladly provide but as you can imagine I wont be able to display the entire program...

Eagletalon 34 Junior Poster in Training

Hey Everyone,

I have run into a bit of a problem with regards to application startup...

I have written a C++ application with QT libraries that uses active QT to communicate with our ERP system in our business, the requirements are that any application we use needs to communicate its variables into this application by means of an argument list that uses unique splitters, and the application then checks the command (seperate argument) and handles the variables and inserts into XML to communicate them to the ERP

my issue is this, with larger argument lists (larger applications and more intricate functionality) the application take much longer to start up, functionality from the very first coding line to the finish is quick, as quick as I can possibly get it... but the startup is way too slow...

Is there anything I can do to speed up the startup? can this be caused by the large arguments? or could it be something else, I thought of dll loading as a possibility though I have tested running the application over a network and on the same machine (because to my knowledge dll loading takes even longer over a network) but I found exactly the same result

Thanking everyone in advance for the assistance

Eagletalon 34 Junior Poster in Training

^ now thats mean

Eagletalon 34 Junior Poster in Training

Hi amber... No-one is going to do your homework for you... show us you tried and we will assist where you get stuck... post some code or give errors or problems dont ask us to do everything

Eagletalon 34 Junior Poster in Training

Allright in visual studio, at the top you will see a dropdown box with the text "debug"... change that to "release"... then build the application...

now in the folder you saved the project there will appear a "release" folder, in this folder will be the files you want, this can be run outside your application as an .exe file

Eagletalon 34 Junior Poster in Training

freopen("Document.in" ,"r",stdin);
freopen("b","w",stdout);

is not C++... read the links that zero sent you...

Here is what zero tried to show you:

 ifstream myfile ("example.txt");
 if (myfile.is_open())
 {
    while ( myfile.good() )
    {
      getline (myfile,line);
      cout << line << endl;
    }
    myfile.close();
 }

 else cout << "Unable to open file";
Eagletalon 34 Junior Poster in Training

CASE (ISNULL([QtyOnHand],0)) WHEN < 0 THEN 0 ELSE ISNULL([QtyOnHand],0) END

Eagletalon 34 Junior Poster in Training

Perhaps your excel is not set to display the header & footer even though they are there?

Eagletalon 34 Junior Poster in Training

What exactly is the error you get? I have a feeling that would probably be because of an include that you are missing...

try: "#include <list>"