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

If you want cross-platform then use c++ boost libraries

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

The first thing you need to do is split up the Hotel class into three different classes

  1. GuestInfo
  2. RoomInfo
  3. Hotel

class Hotel should contain an array or vector of RoomInfo classes

class RoomInfo should contain an array or vector of GuestInfo classes, as well as the room number and other objects related to the room. When you need to change the room number all you have to do is locate the instance of RoomInfo from the array/vector in Hotel that has the same room number as the current room number, then simply change the room number in that RoomInfo instance. Of course when you enter the new room number you need to verify that the new room number isn't already taken.

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

Incidentally, I thought sizeof would give the size of whatever type was given to it
be that an int pointer or a double type.

It does -- all pointers have the same size.

sizeof(u_char)

You don't need that part because char and uchar are always guaranteed to be 1.

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

int raw_len = sizeof(MyTest_u_char2) + 1;

That line is wrong -- sizeof takes the size of a pointer, not the number of bytes allocated to the pointer. In this case sizeof(any pointer) is 4 (in most implementations today but could be some other value depending on your compiler). What you want is the const 8. Better to declare a const int for that and use it throughout so that you don't have to repeat magic numbers all over your program.

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

can you please write a program for me

Nice of you to ask, but No, we are not here to do your homework for you.

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

There are several higher-level c++ alternatives, such as C#, Windows Forms (which is CLI/C++), MFC, wxWindows, QT (cross-platform) just to mention a few. C#, WF, and MFC you will want to use Microsoft's VC++ 20?? compiler/IDE.

sss93 commented: Thanks I know but I would prefer learning more of the lower level aspects and making it work to my needs , Ive looked at c# and it seems much simpler and less tedious....however I more interested in accomplishing my goals in C++ +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

if you want to copy the arrays that are declared in oneFunction() into the arrays declared in twoFunction() then onefunction() will have to call twofunction() passing it the two arrays. twofunction() will need two parameters, not one.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
  1. EnumWindows()

  2. See my previous post about gdi functions, especially BitBit()

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

Kind of hard to say what the problem is without knowing the declaration of variables.

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

Maybe, I just added & in my signature and it's ok.

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

read this article for keyboard input

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

They probably need to escapt the \& symbol

[edit]. well, according to the line above & doesn't need to be escaped, so I have no idea what the problem is.

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

Maybe a map is not the best way to go about that. Another way is to create a structure that contains a string for the argv entry and int for counter, then create a vector of those structures. After that, just call std::sort() to sort any way you want it.

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

yes it is opossible, how to do it depends on the operating system. For MS-Windows you need to learn win32 api functions. Here is a good tutorial. After you have learned that you can start learning MS-Windows GDI functions

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

wishes grated. But ...
1. You landed on mars and burned to death
2. you are instantly teleported back 5 billion years long before there people or planets, and no other way to get back home.
3. I stole one for you and now you are in possession of a hot bike, and you get 10 years prison for possession of stolen bike.

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

line 71 must be int main()

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

Why is this an issue here ?

India is the only place where I've read that complaint at DaniWeb over the past 8 years. I wasn't trying to make it an "issue", just a passing comment.

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

If the OP is from India he may not have any other choice but to use Turbo C/C++ because sadly that's what is taught in their universities.

SoreComet commented: agreed +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I just googled for it and found this tutorial as the very first hit

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

If you want to find out if the code works correctly then you have to write driver programs to test all of its features. In main() instantiate an instance of the class then add a few lines of code that call each of the class's methods and print out the results of the calculations. Don't expect other people to do your job for you because it ain't going to happen.

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

found it.

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

I just went to my profile and could not find any way to change username or delete membership. I guess its because I have been a member too long. Doesn't matter -- I was just curious and don't intend to do either.

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

Change user name: how many times can they do that?

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

What do you want from us?

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

wprinf() and related functions work with unicode characters. You may have to change the code page in order for other languages to display correctly.

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

Any idea as to how this question should be done .

Yes -- find out how to use magick++

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

You need to do socket program to send/receive over the internet. Exactly how it's done is operating system dependent, e.g. MS-Windows see turotials for winsock, for *nix there is POSIX sockets. There is lots of into on the net about both which you can easily find by googling. Hardware isn't much of an issue with sockets, your program could care less that kind of hardware is used, such as wired or wifi or what network adapter.

without to much coding and hardware involved"

There is a lot of programming required in C language. Its a little easier in c++, and I think easier yet with CLI/C++ (a .NET language).

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

In a way communism was good for the world -- many of the things we have today was because communism gave us the incentive to build bigger and better things. Space exploration, for example, may not have happened had the Soviet Union not started it first. The microchips used in today's computers were a direct result of that action.

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

line 17 should be moved up so that its within the bracketed if statement that starts on line 13.

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

Attempting to do it a "portable" way is useless becuse *nix doesn't support DLLs, instead it has shared libraries with *.so exension.

Also is there a way I can program for linux on windows?

Only if you run *nix in a virtual machine window and use a compiler for *nix such as gcc and/or g++. Have you looked at any of boost cross-platform libraries to see if there is something you can use?

How can I get a DLL's Parent Window Title?

GetModuleFileName() will return the fully qualified path to the processes that loaded your DLL.

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

I don't think there is anything else in C or C++. Use a different language, such as C# or CLI/C++ (both .net languages). I think php is used for most server-side programming.

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

An answer I am looking for is something along the lines

Post a request in DaniWeb Community Feedback

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

An answer I am looking for is something along the lines

Because that's exactly how its done.

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

You are going to have to create a new lib project in vc++ then, using the makefile you have from *nix figure out what *.c and/or *.cpp files need to be added to that new project. The task won't be easy because makefiles have a tendency to include other files. I have NOT done this nor do I intend to do it.

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

Read about cgi programs, a short tutorial is here

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

Can someone tell me how to write

You already answered your own question.

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

maybe line 6 should have been this: tmp = new int[nCards+1];

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

DisplayAll(Players);

lines 59-61: If that is a prototype then it should be DisplayAll(Players&)

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

From what little I've read about it here you shuld prolbably use Code::Blocks with MinGW, which is the windows port of GCC because png++ is documented to work with gcc and not VC++. That's not to say you can not use vc++, just that the port will be easier with Code::Blocks.

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

what "issues" and what function? If there are compiler errors then post a few of them.

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

xcode is for MAC, not MS-Windows.

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

There are ways to handle that too.

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

instead of all that shifting I just store it in a char array then xmit the array

inx x = -123;
unsigned char buf[sizeof(int)];
memcpy(buf,&x,sizeof(int);
// now just xmit buf
 Serial.write(buf,sizeof(buf));


 // C++ code to convert the captured bytes back into a long integer
 int x;
 memcpy(&x,buf,sizeof(int));

 // or this works too
 x = *(int *)buf;

Not considered in the above code is endianess
Binary data is not directly transferrable between MS-Windows and *nix because the byte order is different.

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

how can i link my file to this question?

One of the items in the purple ribbon above the edit box is Files -- click that link.

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

The first problem is the program is attempting to change data that is stored in read-only memory. String literals can't be changed. You can correct that by storing the string in read-write memory like this:

char data[]="ALOK KUMAR   ASHISH KUMAR   ANKUSH

After that you will want to set pointer t = data.

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

Most likely because there has already been enough said on that thread. It's all about suggestions -- take it or leave it, that's your choice.

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

Is the code beginning on line 21 of Intro.h really in intro.h or is that just a posting mistake? It should be in a file named intro.cpp. If you really have it in intro.h then that is a problem, remove it and put it in intro.cpp.

As for the undefined errors, that means the linker can't find the named symbol(s), check for spelling and/or capitalization errors.