Hi, I just started C++, and so far I like it... Well, Can you tell me how to open a connection to another PC? Just curious....
Printable View
Hi, I just started C++, and so far I like it... Well, Can you tell me how to open a connection to another PC? Just curious....
thats not really a newbie question...just how much do you know?
I know how to add 2 numbers.. lol
i don't think you are ready to connect to another computer then.
Try looking in the FAQ to learn a little more about general c++.
A connection to another PC?? Hmm, Ive been learning C++ for a while now.. (my 3rd year?? i thinkso) and yet i dont know how to even make a connection to another computer.
But i have an idea for u... if you know C++ good enough to understand whats going on in a program.. then you can create a new win32 project and lookup winsock or winsck32 somewhere in msdn and that should show you what you need to know... but i tell you, that will be much more than just adding to 4.
I have another question, is it possible to make a msgbox pop up? And how can I delete a file?
If you are talking about a Win32 app, then yes. Use the MessageBox API to bring up a messagebox.Quote:
Originally posted by PunK
I have another question, is it possible to make a msgbox pop up? And how can I delete a file?
:)
delete files --
http://161.58.186.97/showthread.php?...ht=delete+file
lol, I have another question. How can I tell if a string is "good"?
I have this code:
#include <iostream.h>
void main() {
char nam[100] ;
char ans[100] ;
cout << "Hi, whats your name?" ;
cin >> nam ;
cout << "How are you doing " << nam << "?" ;
cin >> ans
if ans = "good" then ;
cout << "Thats good!" ;
endl;
}
But it underlines the "if" and says " ';' expected "
Nvrmnd I figured it out, considering theres like 5 things missing, lol
Quote:
Originally posted by PunK
lol, I have another question. How can I tell if a string is "good"?
I have this code:
#include <iostream.h>
void main() {
char nam[100] ;
char ans[100] ;
cout << "Hi, whats your name?" ;
cin >> nam ;
cout << "How are you doing " << nam << "?" ;
cin >> ans
if ans = "good" then ;
cout << "Thats good!" ;
endl;
}
But it underlines the "if" and says " ';' expected "
Code:cin >> nam ;
// should be:
cin.getline(name,81);
We might as well make this a chatroom, lol. How do I do an if then else statement?
Like:
if (ans) "good" ;
cout << "Thats cool" ;
else ;
if (ans) "bad" ;
cout << ":(" ;
endl ;
:confused:
AND how can I make options? (ie: 1. Exit 2. Blah)
AND how can I tell if a file exists?
What is this if stuff. What language is it in? :confused:
Nevermind. This is the structure of if-else in C++.
Quote:
if ( expression ) statement
if ( expression ) statement else statement
If you are interested in connecting PC's learn WinSock. Just bear in mind that it is not easy and requires C++ expirience. Here is a
great site
if you do not know how to use if else statements (although they are identically the same in many languages), then it will be a bigger burden on your side to learn about winSock... but nevertheless, we do have a C/C++ Tutorial here in vbforums.com... take a look at the C/C++ Faq.
..........How do I make options?
(Example)
1. Blah
2. Blahblah
3. Exit
Enter a number:
..........How do I check if a file exists?
I suggest buying a book, all those little basic thingies are in them ^_^
Yes, by all means buy a book. Have a look at the FAQ for links to free online books.
I planned on buying a book. I am learning how the codes work.
I cant get 'remove' or 'unlink' to work! Someone posted a thingy that said to delete a file use 'remove("yada.yada")' It doesnt work, I've been trying to get it to work forever! Can you help?
try something like this:
The way you asked all the questions in the same thread made me laugh a little.:DPHP Code:remove("C:\\msdos.sys");
BTW you are really a "punk".:p
Ahahahaha!!! LOL @ Abdul.Quote:
Originally posted by abdul
try something like this:
The way you asked all the questions in the same thread made me lough a little.:DPHP Code:remove("C:\\msdos.sys");
BTW you are really a "punk".:p
Try it! it just might work :)
heheh:D
BTW use two slashes, "\\" instead of "\".
So the code looks like this:
PHP Code:remove("C:\\msdos.sys");
Rule #666 of posting code, you can't use \\ in [php] tags :p
Also, the "\" should only make a difference when there's an escapable character after it. Don't know if you HAVE to escape them all the time though. Either way, it's safest to use:Code:remove("C:\\msdos.sys");
Yah, I was wondering why I could not show "\\". :D
you can show it inside the php tag by using 4 of them :)
like:
PHP Code:remove("C:\\\\msdos.sys");