|
-
Sep 23rd, 2001, 05:00 PM
#1
Thread Starter
Member
Im a newb, plz help
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....
-
Sep 23rd, 2001, 05:03 PM
#2
PowerPoster
thats not really a newbie question...just how much do you know?
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
-
Sep 23rd, 2001, 05:21 PM
#3
Thread Starter
Member
.
I know how to add 2 numbers.. lol
-
Sep 23rd, 2001, 06:48 PM
#4
PowerPoster
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++.
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
-
Sep 23rd, 2001, 07:04 PM
#5
Fanatic Member
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.
-
Sep 23rd, 2001, 08:47 PM
#6
Thread Starter
Member
Another question...
I have another question, is it possible to make a msgbox pop up? And how can I delete a file?
-
Sep 23rd, 2001, 09:17 PM
#7
Re: Another question...
Originally posted by PunK
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.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Sep 23rd, 2001, 09:19 PM
#8
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Sep 24th, 2001, 07:47 AM
#9
Thread Starter
Member
Gah
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 "
-
Sep 24th, 2001, 07:52 AM
#10
Thread Starter
Member
asdf
Nvrmnd I figured it out, considering theres like 5 things missing, lol
-
Sep 24th, 2001, 09:59 AM
#11
Fanatic Member
Re: Gah
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);
-
Sep 24th, 2001, 04:12 PM
#12
Thread Starter
Member
-
Sep 24th, 2001, 05:25 PM
#13
Frenzied Member
What is this if stuff. What language is it in?
Nevermind. This is the structure of if-else in C++.
if ( expression ) statement
if ( expression ) statement else statement
-
Sep 24th, 2001, 05:32 PM
#14
Frenzied Member
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
-
Sep 24th, 2001, 05:38 PM
#15
Fanatic Member
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.
-
Sep 24th, 2001, 07:00 PM
#16
Thread Starter
Member
.................
..........How do I make options?
(Example)
1. Blah
2. Blahblah
3. Exit
Enter a number:
..........How do I check if a file exists?
-
Sep 25th, 2001, 05:11 AM
#17
Member
I suggest buying a book, all those little basic thingies are in them ^_^
-
Sep 25th, 2001, 06:21 AM
#18
Frenzied Member
Yes, by all means buy a book. Have a look at the FAQ for links to free online books.
-
Sep 25th, 2001, 07:08 AM
#19
Thread Starter
Member
I planned on buying a book. I am learning how the codes work.
-
Sep 25th, 2001, 09:30 PM
#20
Thread Starter
Member
Ok, no
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?
-
Sep 25th, 2001, 09:46 PM
#21
PowerPoster
try something like this:
PHP Code:
remove("C:\\msdos.sys");
The way you asked all the questions in the same thread made me laugh a little.
BTW you are really a "punk".
Last edited by abdul; Sep 25th, 2001 at 11:31 PM.
Baaaaaaaaah
-
Sep 25th, 2001, 11:00 PM
#22
Fanatic Member
Originally posted by abdul
try something like this:
PHP Code:
remove("C:\\msdos.sys");
The way you asked all the questions in the same thread made me lough a little.
BTW you are really a "punk".
Ahahahaha!!! LOL @ Abdul.
Try it! it just might work
-
Sep 25th, 2001, 11:30 PM
#23
PowerPoster
heheh
BTW use two slashes, "\\" instead of "\".
So the code looks like this:
PHP Code:
remove("C:\\msdos.sys");
-
Sep 26th, 2001, 12:27 PM
#24
Monday Morning Lunatic
Rule #666 of posting code, you can't use \\ in [php] tags 
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");
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Sep 26th, 2001, 01:13 PM
#25
PowerPoster
Yah, I was wondering why I could not show "\\".
-
Sep 26th, 2001, 04:28 PM
#26
Fanatic Member
you can show it inside the php tag by using 4 of them 
like:
PHP Code:
remove("C:\\\\msdos.sys");
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|