zamaliphe
Nov 17 2007, 12:44 AM
Hello every one Today I’m going to write good c c++ tutorials The tutorials are mine showing my experience in c c++ i my be using some examples rote in some books (if i do i will pot a link or name of the book) And all the tutorials are at the main topic I don’t know how my topic count in this case because all I’m going to do is updates the same topic Any way lets just tray and see First sings first in order to compile your code you need compiler That compiler is an application that converts your code from human readable code to Binary cod or machine code There is allot of compilers out their (I will post some links soon) The first code you might wan do is simple And do some actual work Let’s start with the oldest and greatest and simplest code Hello world You can get that code from almost any compiler as a simple project CODE // hello world.cpp : Defines the entry point for the console application. //
#include <stdio.h>
int main(int argc, char* argv[]) { printf("Hello World!\n"); return 0; } Now what is that code Let’s explain Line after line 1-#include <stdio.h> You tell see that you want to use the input output library In English you can use the keyboard to input and the Screen to output That’s all 2-int main(int argc, char* argv[]) This is the main function You cant compile your code without this function I will explain it later 3-printf ("Hello World!\n"); [To be continuing ……]
Reply
8bit
Nov 17 2007, 03:11 AM
Actually, #include tells that you want to include a header file that contains code. #include "hi.h" would mean that you want to include hi.h from the directory that the file containing that code is in. int argc, char* argv[] isn't really required as parameters for int main() unless you want arguments to be passed from the command line And overall, printf is mainly a C function. C++ has a better way of outputting.
Reply
zamaliphe
Nov 17 2007, 04:05 AM
QUOTE(8bit @ Nov 17 2007, 03:11 AM)  Actually, #include tells that you want to include a header file that contains code. #include "hi.h" would mean that you want to include hi.h from the directory that the file containing that code is in. int argc, char* argv[] isn't really required as parameters for int main() unless you want arguments to be passed from the command line
And overall, printf is mainly a C function. C++ has a better way of outputting. thanks for reblay i will edit the post and i know that c++ use "cout" for outpot and i useed the argc, char* argv[] because i will write som examples about them later i meant the full line #include <stdio.h> not just #include that tels the compiler that i need to use the input output function in c that means the code for this functions is in the file "stdio.h" once moor thanks and fell free to fix any error in my topic
Reply
bhavesh
Nov 17 2007, 01:02 PM
#include<stdio.h> means to include a header file named standard input/output, whose function is explained by Zamaliphe above. And main function is the first function from where execution starts. Zamaliphe, a suggestion to you. You should give/explain whole thing (all functions used by you) at one post itself, no problem the length of the posts increases. Because it gives beginners to learn and people like us to comment on it. In this program, if your motto was only to teach printf function, then there was no need to use the arguments. Also if where planning to show something else with those (as you have said) then you should explain it in one post itself.
Reply
painbringer
Nov 17 2007, 01:49 PM
Hi im a pc programmer and a game programmer i use Dev - c++ your tutorials arent bad but can you please state what application you are using?? Thanks Painbringer
Reply
zamaliphe
Nov 18 2007, 12:44 AM
QUOTE(painbringer @ Nov 17 2007, 01:49 PM)  Hi im a pc programmer and a game programmer i use Dev - c++ your tutorials arent bad but can you please state what application you are using??
Thanks
Painbringer OK in windows i use Dev - c++ also some times i use Microsoft Visual C++ 6.0 and MSDN library and on Linux i like the old fashion compiler gcc on the command line most of times i create and script to automate the compiling process using make or even just bash script and i like c on Linux moor than windows QUOTE(bhavesh @ Nov 17 2007, 01:02 PM)  #include<stdio.h> means to include a header file named standard input/output, whose function is explained by Zamaliphe above. And main function is the first function from where execution starts.
Zamaliphe, a suggestion to you. You should give/explain whole thing (all functions used by you) at one post itself, no problem the length of the posts increases. Because it gives beginners to learn and people like us to comment on it. In this program, if your motto was only to teach printf function, then there was no need to use the arguments. Also if where planning to show something else with those (as you have said) then you should explain it in one post itself. thanks for your suggestion I'm working on it by the way I'm too lazy so it might take few dye's to complete that tutorials and this is not teach print function only this is just start and every one start learning programming like to see what he dos on the screen so teach printf function is the most important sing for beginners thanks for the comment and i have not start even yet
Reply
de4thpr00f
Nov 24 2007, 04:24 AM
Hello, i'm a new user in programming and i'm more interested in web interaction ones. My question is: is c/c++ a good program for web interaction? Is there an easier way to create a gui? What i want to do is a mysql interaction, consult and confirmation, and include that on vb. is it possible?
Reply
Csshih
Dec 3 2007, 05:14 PM
wouldn't a "cout" be easier? with visual C++ 6.0 CODE #include<iostream.h> int main() { cout << "Hello World" << endl; } iostream = input output stream endl = endline
Reply
osknockout
Dec 5 2007, 12:57 AM
@zamaliphe: I believe there *still* is a tutorial section of this site, why not just post this stuff there? Not everyone here is a n00b or needs to see yet another tutorial, and there's a clearly defined forum feature for it. About your code - you gave a PURE C program - for crying out loud, you gave arguments to main(), so what's with the the association with C++? @Csshih: That's technically bad code is why. You didn't declare a namespace for cout. It's a lot easier to write printf() than std::cout any day just because you don't have to stand there all day shifting to get a colon. Logically speaking, it'd still be easier to do a printf() because there's no classes to abstract around. @de4thproof: C/C++ is not the easiest language to perform web interaction in. My recommendation would be perl, but assuming you're doing things with a basis of client-server relationships, PHP would do really nicely too. -And a general question for everybody... why're we treating C and C++ as the same thing? They're not, they're just very well associated with each other.
Reply
Csshih
Dec 7 2007, 04:21 AM
Thanks for the tips, but, I just started learning C++ in high school,  so could you care to explain in layman's terms?
Reply
Latest Entries
Csshih
Dec 13 2007, 06:09 PM
Thanks, that made sense  I guess that Microsoft Visual C++ 6 uses std as default.
Reply
Recent Queries:--
tutorials - 216.21 hr back.
-
begining to learn c - 296.24 hr back.
Similar Topics
Keywords : learn, c, c, beginning, c, c, tutorials, beginners, expert, time
- C Programming Video Tutorials
This is for all the memebers out there looking or need some mroe help (2)
Beginners Guide To C/c++ Programming?
(2) ok so I was wondering if anyone knows where I can find a good, c/c++ dummy friendly guide? my main
reason for want to learn it so that I can make .cab files that do registry edits for ppc. I know
this should be easy to do, Any help would be greatly appreciated. Thx in advanced, Mike....
Dos Game Programming In C For Beginners
(1) There are a number of tutorials available for the intermediate game programmer, but there are very
few good tutorials for beginners who have never drawn a pixel on the screen. A quick search on the
net reveals hundreds of sites devoted to 3D, polygons, texture- mapping and other advance topics,
but the beginner has no where to get started. This tutorial is for C programmers who want to get an
introduction to game programming. find this tutorial at Dos Game Programming in C for Beginners
....
Beginning C++ Programing!
(0) I just started C++ programming but I understand it a lot! You should use the free bloodshed C++
Program just search google for it. So the tut: Here is the code you will be making CODE // C++
Tutorial // First C++ Script #include using namespace std; int main() { cout int nothing;
cin >> nothing; return 0; } So lets say what this means! CODE // C++ Tutorial // First C++
Script This is a comment line. This when compiled will NOT get put into the programming. This is
just for humans who look at the script. I will use these a lot in further tutorials. ....
Returning Back To The Beginning Of An If Statement
(3) I have a bit of code. I am sooo close to figuring out. The only thing I need it to do, is return
back to the beginning of the if statement after the new input is entered to determine of the new
input meets the requirements. Here is my code: Code: CODE int input() //request input
from user { int size = 0, size_even = 0; cout << " Please enter an odd number between
3 and 25: "; cin >> size; size_even = size % 2; // if statement to
determine if the number is between 3 and 25 if((size >= 3) && (siz....
Looking for learn, c, c, beginning, c, c, tutorials, beginners, expert, time
|
|
Searching Video's for learn, c, c, beginning, c, c, tutorials, beginners, expert, time
|
advertisement
|
|