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

You will have to add a resource file to the project. Here are some free resourc file compilers.

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

Within the same class -- yes. Otherise, no.

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

Character arrays can not be compared like that. Either use std::string instead of char or call strcmp() to compare the two strings. if( strcmp(name,"John") == 0) strcmp() returns 0 if the two strings are the same.

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

Console program? Use your mouse, right-click on the text, select "Mark" from the menu, highlight the text then press <Enter>. Next, in Notepad press Ctrl+V

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

If you don't already have MinGW then download codeblocks-10.05mingw-setup.exe

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

vc++ 2010 Express
Code::Blocks

google for them and you will find the links

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

I would create a function that reads a file into an array. The parameters to that function would be the name of the file and the array. Then in main() -- or somewhere else -- call that function as many times as you want to with different parameters each time.

In c++ it would be easier to use a vector instead of a C style array if you can. Depends on what your instructor told you what you have to use.

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

line 86: you are calling the function wrong findLowest(testScore, sz ); But that will produce another error because textScore is NOT an array of floats, but a single float variable.

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

If you have a boot loader and you want it to execute a c program then the boot loader can't just simply use the call statement to do it. Your boot load will have to first load the c program into memory and then start executing it at the beginning of the program, which will normally NOT be main(). C compilers add a lot of code to the beginning of the program, and the last thing that startup code does is call main().

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

This is a case where using using namespace std; is destroying your program. The compiler doesn't know whether to use the pair class you wrote or the one in std namespace <utility> header file. Replace that with using std::cout; and that error will go away.

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

line 20 should be: contributors * thePatrons = new contributors [numberOfContributors];

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

Whether you use VB or PureBasic will depend on what you want to do with them. I know virtually nothing about PB except what I just read on their web site VB 2010 integrates well with all the other programming languages available in Visual Studio, that is, you can mix and match all the languages in the same program if you want to. There are many things that can be easily done in VB that are very difficult in other languages, such as providing Office solutions. But if you don't need all those whistles and bells then BP may be the better solution, and at 79 Euros its a lot less expensive too than the Professional edition of Visual Studio.

One advantage of PB is that the source code is portable to other platforms. VS is not portable.

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

cacls is depreciated. Use icacls and see if that works for you.

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

Oh -- well Duhhhh :)

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

I must be blind because I don't see a code snippets tab or link

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

You have the same problem with other char* variables that you had with line. Just how do you expect sscanf() to work if those are unallocated buffers? sscanf() doesn't allocate the memory, that is your responsibility.

You need to proofread your who program very carefully and make all corrections like that.

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

>>while (fgets(line, MAX_BUFFER, infile) != NULL){

line is a NULL pointer. You must allocate memory for it before you can use it here.
Add this somewhere before that loop line = malloc(MAX_BUFFER);

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

Buy??? Why when Visual Basic 10.0 Express is free.

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

What would your application launcher do that MSWindows doesn't already do?

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

line 19: >> "\t" YOu can't do that with input streams. If the fields are separated by tabs and do not contain any spaces then istream will auto skip the tabs. If there are any spaces in the fields then you can't use >> operator, but must use getline(), such as getline(is, purchase.name,'\t'); Also the parameter to that overloaded >> operator needs to be an reference to the salesTran object, like this: istream& operator >> (istream& is, salesTran& purchase)

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

No, but this works

#include <vector>
#include <string>
using std::vector;

class Weapon
{
public:
    Weapon() {};
Weapon(std::string nm,int dm,float cst) 
{
    mWeaponName = nm;
    mDamage = dm;
    mCost = cst;
}


// Methods
private:

// Data members.
std::string mWeaponName;
int mDamage;
float mCost;
};

int main()
{
    vector<Weapon> wp;
    wp.resize(10);
    wp[0] = Weapon("Sword",10,10.00F);
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

you have to put that inside a function

#include <vector>
using std::vector;
#include "weapon.h"

int main()
{
   vector<Weapon> wp; // you can make this global if you wish
   wp.resize(12); // this must be inside some function
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

There was a link to Code Snippets, but I can't find it any more. Or did you delete them all?

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

you can only put inline executable code in a header file -- mark that function as inline, like you did the other functions.

It is customary to put inline functions inside the class definition, not outside of it.

#include <iostream>

#ifndef EMPLOYEE
#define EMPLOYEE

class Employee
{
 public:
  Employee(long id = 0, string last = "", string first = "",char EmpClass = ' ', double salary = 0) : myId(id), myLastName(last), myFirstName(first),myEmpClass(EmpClass), mySalary(salary) {}

  virtual void display(ostream & out)const
  {
     out << myId << endl << myLastName << ", "
      << myFirstName << endl << myEmpClass << endl
      << "$" << mySalary << endl;
  }
  double getSalary() {return mySalary;}

 private:
  long myId;
  string myLastName,myFirstName;
  char myEmpClass;
  double mySalary;

};




inline ostream & operator<<(ostream & out, const Employee & emp)
{
  emp.display(out);
  return out;
}


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

Have you tried ths?

Your 16-bit assembly program can not call any of the win32 api graphics functions so you will have to bite the bullet and write it all yourself. I would suggest you get Turbo C graphics library and learn how to call those functions from your assembly program.

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

>>$ g++ EmployeeList.h
You can't compile header files like that g++ EmployeeList.cpp

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

add #pragma comment(lib,"Winmm.lib") somewhere in your *.cpp program, preferably before main()

BTW the program works ok on my computer -- 64-bit Windows 7.

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

vector<Weapon> wp;

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

Continue posting and you will eventually find out what they are. Some members (mods, previous mods, and members who have made monetary contributions) can customize the rank title.

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

The maintenance stage kicks in after the software has been finished, tested, and released. This stage consists of fixing bugs and possibly simple or small new requirements.

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

>>if you can write the rest i would be greatly appreciated

Please deposit $1,000,000.00 USD in my PayPal account and I'll be glad to write it for you :)

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

Why stop learning at 100? One is never to old to learn something new!!

Because by that age it is a challenge just to play bingo or do personal hygiene

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

That the constructor throw an exception if the parameter data is not valid. This is the simplest kind of exception handline -- in actual program you will want to expand it to throw better exception messge.

class MyClass
{
public:
   MyClass(int one, int two)
   {
      if( !one || !two)
          throw;
   }
   // finish initialization here
};

int main()
{
   try
   {
       MyClass(0,1);
   }
   catch(...)
   {
       cout << "MyClass exception caught\n";
       return 1;
   }
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

It would be simpler to use an int as the current index into the array instead of a pointer. When the index value reaches the end of the queue then just reset it back to the beginning.

void enqueue(char *p){
    strcpy(pq->names[(pq->tail)++],p);
    if( pq->tail == &names[QSIZE] )
        pq->tail = &names[0];  
     printf("\n\n\t\t Element Successfully Inserted");
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>Am I too old to do some courses and become a programmer???
Not unless you are over 100 years old :) I didn't start programming career until I was in my early 40s.

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

What happened to the Code Snippets link?

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

Sorry to say but that is not a linked list -- its just an array. Linked lists look somethig like this:

typedef struct _tagNode
{
   struct _tagNode* next;
   struct _tagNode* prev; // circular list
   char name[30]; // node data
} NODE;

NODE* head = 0;
NODE* tail = 0;
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

lines 16 and 17: delete them because it isn't necessary to zero out the registers before moving some other value intol them.

line 45: why compare bl with the loop counter? bl contains one of the integers from the array. Similar with line 54. I think you need to put [ and ] around si+1

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

What is it supposed to do? Use a debugger to single step through the program to see why it doesn't do what you want it to do.

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

now (even though you didn't ask but you might find it interesting), there is another way to swap to numbers without using the temp variable. With a simple math trick you can do the swap:

That will work for very small numbers, but not for large numbers because a+b will cause data overflow, and the result of that is undefined behavior.

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

You are pretty much SOL if you think you can do that without using any of the operating systems API functions because the OS will not permit your program to directly access the hardware. I assume you are talking about USB flash drie, not a memory card. They don't need to be formatted, just plug it in and its all ready to copy whtever files you want onto it. If it already contains files that you want to remove then just write a C program to delete all those files.

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

It would be easier to create the thread outside the class, in main() for example, and then instantiate the c++ class inside the thread function. I don't know how to create a thread in *nix so you will have to figure that one out yourself. But here is the general idea.

class MyClass
{
   // blabla
};

int myThreadFunction(void* parameter)
{
   MyClass c;
   // do things with this class
}

int main()
{
   // create the thread here
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>Get Bloodshed

That compiler hasn't been updated for quite a few years now and uses an old version of MinGW. Code::Blocks is current and still being supported by its writers. Bloodshet isn't.

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

What do you mean "boot a c++ program" ? Compile it? You need a good c++ compiler such as Code::Blocks or VC++ 2010 Express.

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

delete all those lines with cin.ignore(). It's only useful after entering an number with >> operator.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
void clrscr()
{
   system("cls");
}

The above is only useful for MS-Windows. If you are using *nix then change "cls" to "clear"

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

client creates a packet of data that contains the ip address of the destination clinent and the message. Send that packet to server. Server receives the packet, checks the destination ip address and forwards it on the that client.