Recommend Programing
Re: Recommend Programing
I am writing this because now i have my free 30 mins.
Please Tell me this.
I want to learn Programing after my exam.
I have found a nice C tutorial from Vidusara news Paper. Now tutorial the is over, it explained the basic. It explained until open and write to files with C. After that tutorial is over. It said it's the basic.
you said me to start programing with C++. So i decided to ask you may i learn C or learn C++ from your tutorial. Or Study both at same time.
I can learn easily with Vidusara news paper's tutorial.
So what i do?
Thanks
Please Tell me this.
I want to learn Programing after my exam.
I have found a nice C tutorial from Vidusara news Paper. Now tutorial the is over, it explained the basic. It explained until open and write to files with C. After that tutorial is over. It said it's the basic.
you said me to start programing with C++. So i decided to ask you may i learn C or learn C++ from your tutorial. Or Study both at same time.
I can learn easily with Vidusara news paper's tutorial.
So what i do?
Thanks
Re: Recommend Programing
Nipuna, do not concentrate on these now. I'll guarantee that you can learn everything as you want after your exams. We all will try our best to get you started. But you will not get a chance for your exams again. So give your 100% for that.
Every computer language is capable of doing almost everything. So the most important thing is to learn programming techniques like data structures, algorithms, coding concepts, etc... All these things are easy to learn if you put up a proper plan.
C++ addresses more modern world requirements like Object Oriented Programming than C. Though the syntax and semantics are almost same, these minor differences has made C++ to be the future of C. So you better start with C++.
C# would be another good language to start with. It is getting more popular over other languages in .Net family since it is very close to C/C++.
Anyway, we can discuss all these things after your exams in great detail. So for now, please concentrate your studies. Good luck bro !!!
Every computer language is capable of doing almost everything. So the most important thing is to learn programming techniques like data structures, algorithms, coding concepts, etc... All these things are easy to learn if you put up a proper plan.
C++ addresses more modern world requirements like Object Oriented Programming than C. Though the syntax and semantics are almost same, these minor differences has made C++ to be the future of C. So you better start with C++.
C# would be another good language to start with. It is getting more popular over other languages in .Net family since it is very close to C/C++.
Anyway, we can discuss all these things after your exams in great detail. So for now, please concentrate your studies. Good luck bro !!!
Re: Recommend Programing
Thanks I will do
Re: Recommend Programing
I tried this tutorial with Bloodshed Dev C++ but it show some errors. I know Turbo C is good for this but i don't like its interface so please tell me another that compatible with this tutorial.
Re: Recommend Programing
Just like any IDE, DevC++ is perfectly fine for programming c++. I recently started programming myself, and I use it too.
Maybe you can start all over, and re-install it with the following instructions my instructor gave me:
Installation:
If you're still having trouble, please post your code and the error you're getting, maybe I can find what's going wrong.
Maybe you can start all over, and re-install it with the following instructions my instructor gave me:
Installation:
First-time configuration:Language -> English
Compiler -> Mingw gcc (deselect the MS VC++ 2005 compiler)
I agree -> Yes
Choose Components -> choose all preselected components
Choose Start Menu Folder -> choose preselected folder
Choose Install Location -> choose preselected location
The installation starts, and will take a few minutes.
There is another question about the Dev-c++ first time configuration.
Choose (to save time) O no, I prefer to use C++ without …
I also added a .doc which explains in detail how to write your first program with Devc++Select from the menu Tools, select then Editor Options and Display. Check Line Numbers, close the window with Ok.
Select from the menu Tools, select then Environment Options, Files & Directories, and User’s Default Directory. Use the button at the end to browse to choose the default working directory, for example C:\My Documents\MyCppFiles. Close the window with Ok.
Select from the menu Tools, select then Environment Options and General. Check Create Backup Files. Close the window with Ok.

If you're still having trouble, please post your code and the error you're getting, maybe I can find what's going wrong.
Last edited by Neo on Wed Aug 18, 2010 2:21 am, edited 1 time in total.
Reason: Placed the attached doc to the post using "Place inline"
Reason: Placed the attached doc to the post using "Place inline"
Re: Recommend Programing
here is the codeBertus wrote:Just like any IDE, DevC++ is perfectly fine for programming c++. I recently started programming myself, and I use it too.
Maybe you can start all over, and re-install it with the following instructions my instructor gave me:
Installation:First-time configuration:Language -> English
Compiler -> Mingw gcc (deselect the MS VC++ 2005 compiler)
I agree -> Yes
Choose Components -> choose all preselected components
Choose Start Menu Folder -> choose preselected folder
Choose Install Location -> choose preselected location
The installation starts, and will take a few minutes.
There is another question about the Dev-c++ first time configuration.
Choose (to save time) O no, I prefer to use C++ without …I also added a .doc which explains in detail how to write your first program with Devc++Select from the menu Tools, select then Editor Options and Display. Check Line Numbers, close the window with Ok.
Select from the menu Tools, select then Environment Options, Files & Directories, and User’s Default Directory. Use the button at the end to browse to choose the default working directory, for example C:\My Documents\MyCppFiles. Close the window with Ok.
Select from the menu Tools, select then Environment Options and General. Check Create Backup Files. Close the window with Ok.
If you're still having trouble, please post your code and the error you're getting, maybe I can find what's going wrong.
Code: Select all
#include<<iostream>>
using namespace std;
int main ()
{
cout <<"This is my first program. Say hello!";
return 0;
)
I don't want to Insert this code
Code: Select all
int main (int argc, char *argv{})
Code: Select all
int main ()
Re: Recommend Programing
The complete form of the "main" function is as follows.
NOTE: after argv, you need to use square brackets (not curly brackets).
This form of "main" is required when you run your exe with command line arguments. For example, say your compiled exe is myprogram.exe. You need to pass some parameters to it. So you run it as below.
Notice that 15, nipuna and 85 are command line arguments. If you run your program as this, argc will be set to 4 and you'll be able to access them using argv as below.
argv[0] is set to "myprogram" (The name of the exe with path is always set to first element)
argv[1] is set to 15
argv[2] is set to "Nipuna"
argv[3] is set to 85
However, if your program doesn't accept command line arguments and doesn't have any return type (simplest form), you can define it as below.
This is also equals to,
If you have a integer return, you can deifne it as below.
I'm sure you are now clear on function "main" now.
As Bertus stated, make sure you add your code with compile/link error(s) as nobody will spend time to run your code.
I can see a little mistake in your code. Use #include <iostream> instead of #include<<iostream>>.
Code: Select all
int main (int argc, char *argv[])
This form of "main" is required when you run your exe with command line arguments. For example, say your compiled exe is myprogram.exe. You need to pass some parameters to it. So you run it as below.
Code: Select all
myprogram 15 nipuna 85
argv[0] is set to "myprogram" (The name of the exe with path is always set to first element)
argv[1] is set to 15
argv[2] is set to "Nipuna"
argv[3] is set to 85
However, if your program doesn't accept command line arguments and doesn't have any return type (simplest form), you can define it as below.
Code: Select all
void main(void)
Code: Select all
void main()
Code: Select all
int main()
As Bertus stated, make sure you add your code with compile/link error(s) as nobody will spend time to run your code.
I can see a little mistake in your code. Use #include <iostream> instead of #include<<iostream>>.
Re: Recommend Programing
Neo
I now i understand why I couldn't compile my Program with Dev C++. Because i Coded it as this #include<<iostream>>.
I corrected it as you said #include <iostream>. Now my Program works.
But i can't see anything it executes then despairs.
I think i have to add another core before return 0; isn't it?
Thanks
Here is my Code now.
I now i understand why I couldn't compile my Program with Dev C++. Because i Coded it as this #include<<iostream>>.
I corrected it as you said #include <iostream>. Now my Program works.
But i can't see anything it executes then despairs.
I think i have to add another core before return 0; isn't it?
Thanks
Here is my Code now.
Code: Select all
#include <iostream>
using namespace std;
int main ()
{
cout <<"This is my first program. Say hello!";
return 0;
}
Re: Recommend Programing
Add following line before return to wait until you press a key.
Code: Select all
cin.get();
Re: Recommend Programing
Adding a system("PAUSE") will do the trick. So your code will be:
If I were you I wouldn't worry too much about the advanced stuff like the command line parameters. I've been practicing c++ for a couple of months and I also don't know what it all means 
So just focus on the basics first, data types, control structures, classes, etc.
Code: Select all
int main ()
{
cout <<"This is my first program. Say hello!";
system("PAUSE");
return 0;
}

So just focus on the basics first, data types, control structures, classes, etc.