Hi there fellows!
I am absolutely new to programming and stuff. I've been said that it is worth the effort to lear how to use vi and program in linux systems, like FreeBSD named in the title of the post.-
I have so far managed to get a text file with vi, named it helloworld.cc nad am trying to compile it now.
Thing is that I get an error, which is:
error: use of undeclared identifier 'cout';
As I said, I am new, and do not know much about this, apology if question is quite too 'begginer-style'.-
Also, I'd like to ask if there is an specific tutorial for this purpose of writing and compilin(and running!) stuff in C++ I've been googling for quite some time, but find so many different things, advices and tutorials, that I get confused, so it would be great to get some info from someone that knows about it. It's not lazyness in search! HE he...
Thanks!
1 2 3 4 5 6
# include <iostream>
int main()
{
cout << "Hello World!";
return 0;
}
Oh! Great!
Thanks for your reply, Hp of Legend. I really am thankful. It works! Does the Deitel book lie? =D In the Deitel book also states that we must use iostream.h, but I read here that it's deprecated.-
Thanks for your explanation, I have tried it and it compiles and works. Think I have a great long way ahead, uh?
I'll also follow your advice in concern to the tutorials section. I am really used to windows stuff, you know, it's 'easier', many things are done for one, and want to learn Linux/FreeBSD.-
Regards! And, thanks again, your help is highly appreciated.-
// Fig. 2.1: fig02_01.cpp
// Text-printing program.
#include <iostream> // allows program to output data to the screen
// function main begins program execution
int main()
{
std::cout << "Welcome to C++!\n"; // display message
return 0; // indicate that program ended successfully
} // end function main
Hey! I'm sorry for delay in response, apologize!
Thanks JLBorges. I'd LOVE to be able to buy those books you name, thing is I live in argentina, and it's not so easy to get your hands on them. This is the thing I've been able to find. WOW with the compile line, I just:
c++ myprogram.cc
=S
Thanks to you too, anup30. Yes it's old, not older than me nevertheless =P He he.-
Oh, I see that it has changed the cout thing, I must add std:: intead of just using it alone. I like theory, and it's really clear for me in that book, but I see that I have to update the coding part. I'll try my best =D
JLBorges, my man, your are as good as reading The Aleph, when he finally gets to see it... Thanks indeed for your answer and the links, and specially your intention to share and help.-
Should I mention that the Deitel book I have is physical, paper, ink, pages =D That's the reason for I've found it quite old. But I also read from the pc, so this is highly appreciated.-
Great! I am really thankful.-
Yes! Thanks a lot anup30!
I see it was a good plan to ask here, great answers, and specially your concern to help.-
Great, I am very thankful, greetings to everyone. I guess I have a BIG way ahead, might I not come here very often, but I'll surelly will. Hope some day it can be to help too! =D