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

That will not give you the MSB of a character. Use the shift << operator to get that. Here is a tutorial about bit operators

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

line 5: wrong data type. Should be elementType, not int.

move lines 3, 4 and 5 down into the if statement. No point in doing that extra work when head is a NULL pointer.

line 20: at this point you need to allocate a new node to insert into the linked list. You didn't post getNode() so I'll guess that it just returns the node where the new node should be inserted.

nodeptr NewNode = new node; // I'm assuming the underlying structure is named "node"
NewNode->data = elt;
NewNode->next = insertPtr->nex;
insertPtr->NewNode;

line 30: What will that do if the value of n is greater than size()?

The delete function has a memory leak because it doesn't destory the nodes that are removed from the linked list.

while( currPtr != NULL)
{
   nodePtr hold = currPtr;
   currPtr = currPtr->next;
   delete hold;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

First you need to learn SQL. If you alreay have that down pat then just create the UPDATE string and send it to the DB like you do the SELECTs. From c++ perspective there is no difference between the two, its just that queries are a little more difficult than updates because you have to process the result sets from queries.

If you re having problems writing the UPDATE string then post what you have so that we can provide specific help. You basically have to expand the string to include the value of all variables, much like you do when displaying it on the console screen. std::stringstream class can help you out with that.

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

The ones you see on TV are not programs that are running on a computer. They are embedded programs that are burned onto PROMs which are then physically attached to the hardware box on the wall then wires go from that box to the door which unlock it.

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

What kind of database are you using? SQL, like MS-Access and MySQL?

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

It is perfectly ok to use char variable as an index to an array -- in fact it is very handy thing to do at times. For example lets say you need to count the number of occurrences of each letter in a sentence. To do that just loop through the string and use each character as the index into an int array. No typecasting is needed because type char is already an integer (one byte integer).

int count[255] = {0};
std::string sentence = "Hello World";

for(int i = 0; i < sentence.length(); i++)
{
   ++count[sentence[i]];
}

for(int i = 0; i < 255; i++)
{
   if( count[i] > 0)
   {
      cout << "Letter " << (char)count[i] << ": " << count[i] << '\n';
   }
}

And now I've gone and done someone's homework.

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

fgets() is the correct function, you just didn't use it correctly. google for that function and you will find out how to use it properly. Yes I can easily tell you how but you need to learn how to find it yourself so that next time you will know how to do it.

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

Let the US Federal government impose the tax consistently throughout the USA and its posessions, then make quarterly payments to the individual states based upon their representation in the House of Representatives. That means all consumers will pay, for example, a 5% sales tax regardless where they live (USA or otherwise).

But guess what??? Such a plan will fail because consumers will buy from non-US sources who impose no such tax. It will also fail because it will make our eCommerce businesses less competative than foreign ones.

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

A couple problems:
1) line 11: you have to set number to 0 so that the loop will stop

2) line 27: change data type to int because that's what palindromecheck() expects as its parameter.

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

Depends on the university. Some have them split apart, e.g. MIS may be part of Business Administration.

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

You mean something like this?

int x = 123;
int* pX = &x;
printf("%d\n", *px);
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>> fgets (string1);
Your compiler should have given you an error on that line because fgets() requires three parameters.

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

You don't want to use those functions. google for "ODBC Tutorials" and you will learn how to read and update any SQL compliant database, such as MS Access, SQL Server, MySQL, Oracle, Sybase, etc. You will also need to learn SQL scripting language. google for SQL tutorials too.

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

Welcome to DaniWeb. Sure wish you would create your own web site and post pictures of what you do there in the desert. I lived in Tucson for a few years during 1970s and whish I could go back.

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

The problem really isn't how to include windows.h but how to get the HDC parameter that most win32 api graphics functions require. I don't know how to get that either from managed code.

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

IMHO it isn't work the paper its written on.

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

When you don't remember where you put those reading or magnifying glasse.

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

Welcome to DaniWeb. Most likey no one can help you. This is an IT forum, not some sort of human language translation forum. But you might get the translation by using some online translation web site -- google for it. Don't be surprised if the translation isn't something very silly. Some words don't translate into English very well.

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

There is a '\n' at the end of every line. getline() won't work right if you don't remove it from the previus line. And for strings >> won't work if there is a chance that there might be spaces in the name and/or ID fields. such as "John <space> Doe"

I said your code snippet isn't right because eof() does't work that way and because its too overly complicated and awkward. There is no need for the array of Student structures with only one element nor is there any need for all those temp variables. Simplicity is the key to good programming. Don't try to impress anyone with your c++ skills, it only makes you look bad.

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

I haven't the slightest idea how to do it, but I would start with that program and see how it does the basic things.

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

You mean like this, but in c++ instead of C#?

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

Well, Mr. blackrainbow, your solution isn't much better than the original. This assumes no white space in either the name or ID rows of the file.

Student t;
    while( fileread >> t.name >> t.ID >> t.grade1 >> t.grade2 >> t.grade3 >> t.grade4 )
    {
        database.push_back(t);
    }

If it can contain white space then do it like this

Student t;
while( getline(fileread, t.name) )
{
   getline(fileread.t.id);
   fileread >> t.grade1 >> t.grade2 >> t.grade3 >> t.grade4;
   fileread.ignore(); // remove '\n' at end of line
   database.push_back(t);
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Didn't you even bother to read this thread? No one here is going to write the code for you.

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

I think Windows Forms and VB.NET both have web browser controls.

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

>copyPtr = originalPtr;

That is just changing the pointer, not the contents of the arrays. You have to add * to each, such as *copyPtr++ = *originalPtr++; You also have to increment both pointers. So the loop becomes

while(*originalPtr)
{
    *copyPtr++ = *originalPtr++;
}
*copyPtr = 0; // null-terminate it
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

There is a message loop and queue already -- its inside the MFC internals and hidden from you.

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

but...What is IMO

IMO = In My Opinion

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

I mean that they are not part of the standard C or C++ libraries. Standard functions are defied by the c and c++ ISO standards committee and every c or c++ compiler must implement them. You will find lists of standard functions in most text books related to c and/or c++ languages. Anything not identified as standard is, by its very definition, non-standard.

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

non-standard functions. google and you will find out how to use them.

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

>>the "I keep a gun to defend myself from the government" position certainly won't find any help here.

But it sure would if all citizens were armed and willing/able to use them when Hitler took over Germany. And we would do the same if someone tried to pull a coup d'état in USA.

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

How the stacks are allocated is compiler and operating system dependent. The stacks for all threads might be in contiguous memory, but then again they may not. When a new stack is needed the program will ask the operating system for a block of read/writeable memory, then use it as stack. The operating system doesn't know, or even care what the program uses the block of memory for.

Here is an explaination for how VC++ checks stack

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

Aftrer main() finishes that loop reading the file the ifstream is located at end-of-file. Therefore test() can't read the file again. In test() call fseekp() to reset the file pointr back to beginning of file

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

MSDN is the authority on _variant_t and VARIANT structure.

How is bbVariant declared? Is it _variant_t or VARIANT* ? If its _variant_t you don't need to call VariantClear(), but call it's Clear() method.

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

>>scanf("%c",t->wallet);

Scanf() %c requires a pointer to a character, but all you are passing is a char itself. Change t->wallet like this: scanf("%c", &t->wallet); The the same with other scanf() functions.

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

The stack size you specify in the makefile for linking is only for the main thread. It does not include the other threads that the program may create during runtime.

Here are other suggestions.

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

And did you read this part of the article? The cops were completely at fault for that killing, which should not have happened.

Three officers were tried for manslaughter and other charges surrounding falsification and were sentenced to ten, six, and five years respectively.

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

Yes, YOU have to write the code. I did some of your homework for you, so now you can and should finish it up.

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

This is not for someone who doesn't know a thing about C and/or C++. If you are that new then start somewere else, not with Allegro.

The zip file contains a build directory in which the project files for different compilers are stored. The Microsoft VC++ 6.0, 2005 and 2008 are the only compilers directly supported. If you want to use another compiler such as Code::Blocks you will have to create the project yourself.

It would seem to me that the easiest way to do that is to first load the project with one of the supported compilers, look to see how the files are arranged then create a similar project with CB. There are a lot of files, so it may be somewhat time consuming to duplicate the project with CB.

You will also have to read the file "msvc.txt" located in C:\Allegro\docs\build folder (or whereever you extracted the zip file).

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

win32 api function CopyFile() can be used with any file type. Post your code so that we can see what you did wrong. When CopyFile() returns zero value, get the error number from GetLastError(). Then call FormatMessage() to get the error message text.

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

>>when i try load Array (mMemory) whit data from txt i have error
What error? The code you posted does not atempt to read mMemory from a text file.

And why is that in a loop?

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

You have check _variant_t's vt member to find out the valid type of the variant. The value of vt after Clear() is called is 0, meaning that _variant_t object does not contain any valid data.

It's a very similar concept of deleting a string but not resetting the pointer to NULL. The pointer will still contain an address to some memory location where the array of characters resided but that memory location no longer is owned by the pointer and the contents of that memory location is subject to change at any time.

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

Note: Untested and uncompiled code below. Use at your own risk.

FILE* fp = fopen("file.txt","r");
char line[255];
while( fgets(line, sizeof(line), fp) )
{
   int len = strlen(line);
   if( line[len-1] == '\n')
   {
      line[len-1] = 0;
      --len;
   }
   // make test for "= 9999999999" here
   if( (len > 13) && strcmp(&line[len-14],"= 9999999999") == 0)
        ; // do nothing
   else
   {
       // the line is ok, so write it to the output file

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

>>if( !isalpha(name[31]) )

That is wrong -- it is checking the 31st character in the array, not the first character. Replace 31 with 0

I suppose it should also be checking each character in the array, not just the first one. So you will want to make a loop to check them

int i;
int valid = 1;
for(i = 0; name[i] != '\0'; i++)
{
   if( !isalpha(name[i]) )
   {
     valid = 0;
     break;
   }
}
if( valid )
{
    // put all those print statements here
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

It doesn't matter how the string was generated. Take the example that firstPerson posted and modify it for use it in your program.

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

Yes it will help. By itself it won't get you a job, but it will get you in the door to get an interview. Its up to you to show your stuff (knowledge and skills) during the interview.

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

my guess is that you have already used the symbol "name" somewhere eariler in your program.

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

If the table has two or more columns then you have to specify the column names add values for all columns.

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

<deleted>

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