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

You need to add anothe integer to keep track of the loop counter when the value of biggest is changed so that the program knows which array element contains the largest value. Then you can just simply return return &a[bignum]; where bignum is whatever you want to name the new integer.

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

>>How am I ever going to figure out the actual algorithm for the functions!!

Just like everyone else does -- use your compiler's debugger and single-step through the program at runtime.

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

Enable the Expert option -- Tools --> Settings --> Expert Settings. You will get additional menu items.

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

cin.ignore() is not needed after calling getline() -- delete them

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

line 14 should be while (tokens[i-1]!=NULL)

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

line 5: when using strtok you don't need the length of the string. You have to call strtok() once before the loop, the first parameter is array and the second parameter is " " (one space), assuming tokens are separated with spaces. If they are separated by some other character, such as tabs, then use "\t".

So the program will be somethin like this:

char *sptr = strtok(array, " ");
while( sptr != NULL)
{

   // do something with this token

   // now get anoter token
   sptr = strtok(NULL, " ");
};

If you want to use both spaces and tabs as tokens, then use " \t", and strtok() will use either one.

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

There is no common way to program touch screens because every manufacturer writes the screens differently. A program written for one type of hardware may or may not work on another. You have to contact the touch screen manufacturer to find out how to program for it.

In many cases the touch screen manufacturer may have written a device driver for the operating system on which it is used. If that case you need to find out how to use that device driver.

I wrote a touch screen program some 15 years ago in C languge that just communicated with it by sending commands to stdout. The touch screen driver captured everything going to stdout and if it was a TC command it would use it otherwise it would just send it on to wherever stdout would normally go. In order to write that program I had to read a programmer's manual that the manufacturer wrote.

I would hope touch screen technology has advances a little bit since then and interface is a little more elegant.

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

The tokens array should be an array of pointers. what will happen if you enter a word with more than 19 characters? Anbswer: buffer overflow. The following will be ok as long as you are not going to change the contents of sentence again, such as use that characte array for something else later on in the program.

line 16: That while loop is wrong

char* tokens[20] = {0}; // an array of pointers
tokens[i++] = strtok(sentence," ");
while( sptr != NULL)
{
  printf("%s\n", tokens[i];
  tokens[i++] = strtok(NULL, " ");
  
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Or CreateProcess which is only for MS-Windows

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

line 2: delete conio.h because its non-standard and non-portable.

line 16: void main(){

It's always int main() void main() is non-standard and therefore non-portable.

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

>>i don't know how can i use something like "cut",
There is no such term.

It's pretty easy to get the digits

int x = 123;
int digit;
while(x > 0)
{
   digit = x % 10;
   x /= 10;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>The problem is when I enter 7 digits for Id it works

No it does not work because the ID field of the structure is not large enough to hold a string of 7 characters plus the NULL terminating character. You need to increase the size of id to 8 char id[8];

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

you have to make x1 the base class of x2. Study up on ingerentence. In your example X2 will be unable to access the private variables of X1 -- you will have to make those variables either protected or public.

class X2 : public X1
{
   // blabla
};
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>if(f1.maxSize < f2.maxSize)

Look at that class -- maxSize is a simple integer, not an array. Why are you trying to use it as if it were an array of ints?

I don't see a difference between lines 190 and 192 -- the two if statements are the same. Perhaps line 192 should have been else if(f2.maxSize < f1.maxSize) If line 196 is reached it means that f1.maxSize == f2.maxSize. So what is the purpose of that loop inside the else statement?

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

Set the OFN_NOCHANGEDIR to the Flags item in the OPENFILENAME structure and it will not change the program's current working directory.

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

What compiler? What operating system? Use of semiphores and mutex is operating system dependent. But neither of those will help you with interprocess communications. If you are opn *nix one way to do it is via shared memory. MS-Windows has something similar called the clipboard. Another way to exchange information is via the file system, or you could use sockets or pipes.

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

A matrix usually has the same number of columns on each row, for example this is a 3x3 matrix

1  0  1
2  3  4
5  6  7

I can't tell what the numbers mean in the file you posted.

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

So how is that file supposed to be interpreted?

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

First write the code that reads the input file into a matrix. What's the size of the matrix (rows and columns)? Or does the input file contain the number of rows and columns and your program is expected to dynamically create the matrix at runtime.

Post the contents of the input file.

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

Don't open the output file for every line you want to write to it. Open the output file before the while loop and keep the file open until everything has been written to it.

line 17: you are closing the input file before it has been read. Move both lines 17 and 18 down after the end of that while loop. The function should look something like this:

ofstream file3("temp.txt"); // open the output file
while( file >> roomnumber >> category >> type >> status >> datein >> dateout >> rate  )
{

   // do stuff here
}
file.close();
file3.close();
// rename the files here
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

There could be billions of reasons why debug assertion happens. We need to see your program so that we can compile and test it. If that's not possible then you will just have to debug it yourself. Place to start is by commenting out large blocks of code so that you can identify where in the program the problem occurs. Check for buffer overruns and use of bad pointers, which are the two most common errors.

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

Do you know how to calculate the transpose, sub_matrix, determinant, inverse, and multiplication of a matrix on paper? If now then you need to learn it now -- google for those terms and you will probably find wiki articles about them.

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

Do you mean there are two out of 14 computers that can not log into the server? Maybe the server doesn't have enough licenses for that may computers logged in at the same time.

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

The code you posted a couple hours ago --

main() opens a file then immediately closes it. What is the purpose of that? If you are not going to do anything with the file then why bother opening it?

line 51 appears to be outside a function. Move it up before line 50.

>>But wrong way! It won't show anything
Because you never told it to show something. originalLetters() function is never called. Do you own a TV set? If yes, then you know that you have to turn it on before it will show you something. Same in computer program. originalLetters() exists but won't do anything if its never called.

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

Instead of dynamically creating text boxes try using a grid control Here's a free one for C# that you might be able to use in CLI/CPP, I don't know because I have never tried it.

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

How did you compile sqlite.c with windows Forms project? VC++ 2010 Express gives me errors that it can not be compiled with CLI/C++.

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

line 8: ios::out is not valid for ifstream. ifstream is inut stream, not output. Similar for line 13. You have the two backwards. You don't need either ios::in or ios::out because ifstream is always input and ofstream is always output. For tet files the only parameter that is needed is the filename. ifstream in("Textfile.txt"); line 23: since file is an ofstream you have to use << operator, not >>.

line 25: you need to add '\n' to move the cursor to the next line on the screen, otherwise the output will look pretty crappy.

You also need another cin between lines 25 and 26 so that you can enter another letter.

[edit]^^^ also what he said.

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

Here is an example program

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

>>So once the ShowDialog() is called, anything after it is not run until the object of ShowDialog is closed right?


Yes -- but not the same with Show().

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

@brainwood: That's the whole point of halloween -- time to get silly. And I just proved that you're never too old to do silly and stupid things. According to this wiki article Halloween is only celebrated in a few countries, so if you don't live in one of those countries you may have never heard of it.

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

I didn't mean for you to just blindly copy the code snippet I posted 52 times for each character, but use it as an example of how to do it in a loop. I showed you how to do it for one character, now you should be able to expand on that and do it for all the characters is the string. You can put the code in another function if you want to, but that's not really needed.

I think the whole point is to teach you how to solve problems. You won't learn if we do all the work for you.

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

If you want to hide Form1 while Form2 is up then just set its Visible property to false

private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {

             Form2^ f2 = gcnew Form2;
             this->Visible = false;
             f2->ShowDialog();
             this->Visible = true;

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

@dotbat: you are using an ancient compiler that has not been updated for many years now. It's dead and buried. Get Code::Blocks with Mingw, which is current and works on both MS-Windos and *nix.

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

There are lots of exaples all over the net -- for example this one. Google for "c++ polymorph" and you will get more examples.

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

I have a project that does something similar and it works ok, except uses Show(), not ShowDialog(). But I changed it to use ShowDialog() and it worked too.

private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {

             Form2^ f2 = gcnew Form2;
             f2->Show();

         }
};

>>but I can't get back from Form2 to Form1.

You don't have to do anything special, when Form2 is closed Form1 automatically regains control as if nothing had happened.

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

Many city names consist of more than one word. You need to use getline() not >> to enter the city name, such as getline(cin,pNew->cityName);

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

Didn't you teacher tell you exactly what to implement, or did he expect you to design the class by yourself?

Describe the attributes of livig things just like you would the attributes of non-living things. You are human (I assume :) ) and have probably observed many times how dogs behave. It doesn't matter what kind of dog it is they all behave the same way. All (or most) dogs bark, so give the dog class a speak() method and make it bark

class dog
{
public:
   void speak() { cout << "Bark!\n"; }
}

You can do similar with other attributes, such as eat

chass dog
{
public:
   void eat() {cout << "Chomp, chomp!\n";}
};

For your purpose it doesn't matter if it's silly or not as long as you make the class do what dogs normally do.

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

You can't concantinate one string literal to another string literal because both string literals are normally (but not always) placed in read-only memory. What you have to do is below. Your concat() function should work ok as you wrote it.

int main()
{
   char s1[255] = "Hello ";
   concat(s1,"World");
}

>>there must be some other alternative!
There is -- see strcat_s(), but that is not a standard C function.

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

Well, all you have to do is subtract 3 from the character

int main()
{
    char c = 'A';
    if( isalpha(c) )
    {
        c -= 3;
        if( c < 'A')
        {
            c = 'Z' - ('A' - c)+1;
        }
    }
    cout << c << '\n';
        
}

Now put that in a loop and do it for each character in which isalpha() is true. You will also have to modify that program to recognize lower-case characters.

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

Look at any ascii chart and you will see the decimal value of all characters 0-255.

>> and three squares covered by each tile indicated by a distinct ASCII character starting with !,
I have no idea what that means either.

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

>>lines 24 and 25. You can't do it like that -- newcopy must be
Should have been newItem, not newcopy.

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

Before attempting to decrypt that you need to know the shift value, and whether it was shifted right or left. I suppose you could solve it by iterating through all 26 possible shift values ('A' - 'Z' = 1-26) assuming case is ignored.If not then there would be at least 127 possible values, which includes every key that can be typed on the American keyboard (except special keys). First try a shift of 1 Right, look at the results to see if it makes sense. If not, then use 2R and repeat the process.

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

lines 24 and 25. You can't do it like that -- newcopy must be a complete node all to itself, it can not be just a pointer into some other linked list. Allocate it just like you did in the original linked list then copy the data from old node to the new node. After it's all done you should be able to destroy one linked list without affecting the other.

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

The first hex value is the value of the this pointer. The next item after -> is the constructor that was called. If you look in each of the constructors you will find the string that was passed to the out() method -- nothing magical here. The last part in parentheses is the value of the struct's value integer.

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

There is no need for that vector in your program. Remove it and store the data directly into the matrix.

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

Legal Notice
This is an official notice that LimeWire is under a court-ordered injunction to stop distributing and supporting its file-sharing software. Downloading or sharing copyrighted content without authorization is illegal

My advice is to buy with your $$$ the software you want instead of stealing it.

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

I am a student. I install Turbo c++ 4.5 in my pc. But this does not have BGI folder

Great :) You can't learn c++ with that ancient compiler. Get yourself a real compiler for modern operating systems such as Code::Blocks with MinGW or VC++ 2010 Express.

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

There are two ways to use MFC to create a text editor

  1. Use CEdit or CRichEdit class window
  2. Draw all text lines yourself.

>>Also I would appreciate if some basic code/resource can be provided as Help to create a document application
Microsoft provides hundreds of examples and an online tutorial called Scribble.

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

Here you go

#include <iostream>
#include <fstream>
#include <string>
#include <vector>

using namespace std;

int main()
{
    float n;
    vector<float> data;
    ifstream in("float3by3.flt", ios::binary);
    if( in.is_open() )
    {
        while( in.read((char *)&n, sizeof(float)) )
            data.push_back(n);
    }
    // just display the data
    vector<float>::iterator it;
    for(it = data.begin(); it != data.end(); it++)
        cout << *it << '\n';
}