At 5/22/06 08:35 PM, Naois wrote: I'd like to request a tutorial on Functions from one of the C++ masters here.
Made upon your request.
At 5/26/06 01:57 PM, Jcrypt wrote:At 5/26/06 12:51 PM, sheffgb wrote: can i request a tutorial on classes/member functions?Yes, I got dibs on this one fellas :D i'll start it later today or early tomorrow morning!
So... Are you going to actually do it? It's been almost a month...
omg i keep getting this problem, with every program:
when i insert for example this code:
#include <iostream>
int main()
{
std::cout << "Hello World!";
char response;
std::cin >>response;
return 0;
}
and then hit compile and run, the program wont run, and i get an error telling me that some file is not found.
Please help me, i get this with every program!
At 6/18/06 12:14 PM, iv00w wrote: omg i keep getting this problem, with every program:
when i insert for example this code:
#include <iostream>
int main()
{
std::cout << "Hello World!";
char response;
std::cin >>response;
return 0;
}
and then hit compile and run, the program wont run, and i get an error telling me that some file is not found.
Please help me, i get this with every program!
I'm sorry for the late response, but I see the problem. Are you used to typing in php code? If so, that might explain why the error existed.
You see, C++ is not a dynamic language. You must put ALL of your declared variables at the top of int main()
I hope that helps. If it doesn't, oh well...
BTW, I made a big, awesome tutorial on Structures and Classes. It doesn't quite go in-depth with classes yet, but I'm going to probably add that later in the topic.
At 6/18/06 12:14 PM, iv00w wrote: and then hit compile and run, the program wont run, and i get an error telling me that some file is not found.
Please help me, i get this with every program!
I tried it and it worked fine.
have I just bumped a really old thread? oh well
At 7/11/06 12:16 PM, CaptinChu wrote: You see, C++ is not a dynamic language. You must put ALL of your declared variables at the top of int main()
You're thinking of C. C++ allows for variable initialization any where.
#include <iostream>
using namespace std;
int function(int);
int main()
{
int a = 5;
cout<<a<<endl;
int b = 6;
cout<<b<<endl;
int c = 7;
c = function(c);
cout<<c;
return 0;
}
int function(int c)
{
return c+5;
}
Captin Chu's Guide to basic C++ (part two)
I really hope the guides that I've been making were helpful.
I am requesting a nice guide on how to use the swith function in c++, i think it is called a swicth. the command that lets you go,
if a =
1 > do this
2> do this
etc.
as you can, i have no idea how it works for c++
At 8/13/06 10:45 AM, thecoshman wrote: I am requesting a nice guide on how to use the swith function in c++, i think it is called a swicth. the command that lets you go,
if a =
1 > do this
2> do this
etc.
as you can, i have no idea how it works for c++
It's basically a cleaner way to write comparison statements. Don't know if it warrants it's own tutorial though.
---------------
int iValue = 0;
cin>>iValue;
switch(iValue){
case 1: cout<<"You entered 1\n";
break;
case 5: cout<<"You entered 5\n";
break;
default: cout<<"You entered something besides 1 or 5\n";
}
--------------- is equivalent to
int iValue = 0;
cin>>iValue;
if(iValue == 1) cout<<"You entered 1\n";
else if(iValue == 5) cout<<"You entered 5\n";
else cout<<"You entered something besides 1 or 5\n";
--------------is equivalent to
int iValue = 0;
cin>>iValue;
iValue == 1 ? cout<<"You entered 1\n" : iValue == 5 ? cout<<"You entered 5\n" : cout<<"You entered something besides 1 or 5\n";
At 8/18/06 09:28 PM, phyconinja wrote:At 8/13/06 12:44 PM, 0x41 wrote: stuffcan some one like make a tut.. and explaining this?
Im lost at the biggining..
Some day, I'll make my third part to my guide of basic C++. In that, I'll explain if, else, switch, more on functions, and basic structures and classes.
For those few who were wondering, I will stop at the fourth and final part of basic C++, "The last of what I know." It will be on extended classes and everything I know about ios. If you could get through all four parts of my guides... yea, you'd pretty much know everything I do about C++. Pretty pathetic, really. : /
At 8/18/06 10:19 PM, KurtGodel wrote:
:code
hmmm, getting some conflicting information here :-O.
http://en.wikibooks...rogramming/Variables
"In C, all variable declarations (except for globals) must be done at the beginning of a block. You cannot declare your variables, insert some other statements, and then declare more variables. Variable declarations (if there are any) are always the first part of any block."
Are you compiling the C program with a C++ compiler? Maybe I'm (and the wiki editors) are getting C rules and C conventions confused with each other.
C++ GENERAL
============
BEGINNING
C++: The Basics by JFriesen
C++: Getting Started by -Liam-
C++: Guide to Basic C++ (Part 1) by CaptainChu
C++: Guide to Basic C++ (Part 2) by CaptainChu
C++: Datatype and Variables Basics by Johnny_Krysys
C++: Constants by Flash Station
C++: Basic Arithmetic by Afro_Ninja
C++: For Loops by sheffgb
C++: Basic Functions by CaptainChu
INTERMEDIATE
C++: File I/O by Cyrax88
C++: Pointers by Atomic Potato
C++: Structures and Classes by CaptainChu
C++: Linked Lists by -dELta
ADVANCED
C++: Hooking by dave
C++ SPECIFIC
============
BEGINNING
INTERMEDIATE
ADVANCED
C++: 3D Camera by Glaiel_Gamer
C-ONLY
Free Compilers:
Bloodshed c++
MiniGW
OpenWatcom
GCC
Microsoft Visual C++ Express Edition
Visual C++ 2003 Toolkit [SDK and libraries]
Digital Mars
Helpful Links:
C Programming
C Plus Plus
C++ Video Tutorial 1
C++ Video Tutorial 2
Online C++ Tutorial
C++ Tutorials
C++ Programming Tutorial
C++ Tutorial links
C++ tutorial for C users
How C Programming Works
C Programming Tutorial
C Programming
Programming in C
C Programming contents
Learn C/C++ Today
Development of the C Language (pdf)
Open GL Tutorials
Win32 API Tutorial
The SDL API
Writing Un-maintainable code?
At 8/22/06 09:17 AM, phyconinja wrote:At 8/21/06 02:06 PM, Afro_Ninja wrote:Helpful Links:page not found..
C Programming
C Plus Plus
C++ Video Tutorial 1
C++ Video Tutorial 2
Online C++ Tutorial
C++ Tutorials
C++ Programming Tutorial
check the link!!!
They work for me :S
very cool intermediate guide made by me