![]() |
Test Chat in BETA (Not Built Yet)
Hello as the Title Says i am Makeing Something like a Chat room.
I want to make a Place where you can Chose Friends to Talk with. Not alike a Facebook. Example: /* <Name104>: Hey i think that is a good idea. <Name101>: Well Thank you for your Concideration. <Name110>: I Dont like it. But that is Just My opinion! <Name101>: Well that is okay! :) *\ I have Started Basicly with Problems. Told Sorta How to Do it but the Person who told me was Wrong. Code:
#include <iostream>10 mins to Write code. Help Will Deaply Be Appreciated. Michael. PS: A Great way to help a Rookiy is to Help Them understand code that you Put down. Also to try helping Chose Codes to Fit! Will Need Help with a Lot: Linking Chat Repeating Talk //You can write a Spesific code and will say Good Bye and Close Program. system ("Pause") //Never has worked for me. More Problems will be listed later. |
Re: Test Chat in BETA (Not Built Yet)
If you're still at the level of thinking that "if Y = friendsyes;" is valid code then a chat room is a project you should shelve for now and concentrate on working through the exercises in your book. Get the language sorted first, then you can work on more complex projects. A chatroom is NOT a simple task suitable for a beginner who doesn't yet know the syntax of if statements.
|
Re: Test Chat in BETA (Not Built Yet)
And by the way another great way of helping a Rooky is to focus them on what will help them. This chatroom project is WAAAAAAAAAAAY beyond your abilities at the moment: think of a four-year-old child who's just spent 5 minutes playing with a screwdriver and announces he now wants to build a car.
|
Re: Test Chat in BETA (Not Built Yet)
After staring at your....I hesitate to use the word "code"...for a while I figured you probably meant to write something like this:
Code:
int main()So assuming the four-year-old is now all "wanna build a car wanna build a car wanna build a car wanna build a car wanna build a car wanna build a car"... Did you mean this should be LIKE Facebook or UNLIKE Facebook? If unlike, I have no idea what you want it to be like so I'll assume you mean LIKE. Facebook uses a central server to store messages and the users connect through their browsers. What technology are you going to use on the server? Are you going to use a database to store messages or store them in a program's memory? What happens when (not if) the program crashes - all messages will be lost if they're not stored somewhere? What protocol are you going to use between the clients and the server? Are you going to roll your own or use an existing one? The program above - is this the start of the client application or the server application? Or are you going to use distributed technology to store messages and this will be both? If distributed, this will be UNLIKE Facebook because they do NOT use distributed tech; all your messages are stored on their servers. I'll stop there because your brain will now have melted. Maybe back to those exercises in Chapter 3? <grin> But your enthusiasm is great; keep thinking of projects, but be aware that any real-world projects are going to be beyond you right now, although there's nothing wrong with playing around with various ideas. I have a number of projects on the go - chess solvers and the like, even an ambitious compiler suite comprising a C compiler, Z80 emulator, assembler, disassembler, linker etc - that'll probably never get finished; I just get them out every so often when I have that itch to scratch. |
Re: Test Chat in BETA (Not Built Yet)
Okay i get it.
I had only called it BETA since it is Still getting Developed. Also I found a Lotta things i needed just need to do more to Talk with Yourself. So Far i now need to Figer out how to Repet the Same String and write something Different. I still have a long Way to go i know. I also know that i need to put in some counter parts for stoping it killing Your PC. Why: Memory. It will store all that Data and may slow your computer if you do not Reboot. I am not even half way to makeing it Work VIA Lan/Internet. I am up to Looping one Is compleat just need to do the other: else cout << "Trying to Starting Chat Please Wait a Few Moments..." << endl;//Saying It will Run Link "Yes". { string user = ""; //Users name for Chating! cout << "enter Username and Press enter: "; cin >> user;//Telling PC to Hold Username. string chat = ""; //What you Write will be used in Chat! cout << "Now you can Write a Message: " << endl; cin >> chat; //Your Chat Message getline(cin, chat); //The whole Chat message. chatuser } I am still workin on Some misstacks but they will be fixed at the Next Bug Fix Slot Time! Do not run the Above as dose not work = Errors. |
Re: Test Chat in BETA (Not Built Yet)
Found out what i need to sorta do.
One problem can not understand how to do it: Repeat Function How. Loop may not do it as it loops what i don want to loop! EX: #include <iostream> #include <string> #define sentence cout << sentence << endl; using namespace std; int main() { string sentence = ""; // Want to Repeat this base Function. cout << "Write Something: "; cin sentence; ? Have lost myself! |
Re: Test Chat in BETA (Not Built Yet)
Well there are several ways of looping. My code shows you one way. I suggest you experiment with the examples in whatever book/course you are following until you get the hang of them.
The simplest loop - an infinite loop - can be done as follows: Code:
for (;;) |
Re: Test Chat in BETA (Not Built Yet)
By the way this is a really bad idea:
Code:
#define sentence cout << sentence << endl; |
Re: Test Chat in BETA (Not Built Yet)
Oh and a repeat IS a loop. You cannot repeat without a loop, except by unrolling the loop, but that only works if you know at compile time how many times you want to repeat.
|
Re: Test Chat in BETA (Not Built Yet)
Thankyou for your Help.
I have Noticed that It dose not Like the #define chatuser ? And also i was doing well till i hit a wall. All programers hit walls at times! |
| All times are GMT +5.5. The time now is 03:18. |