simple questions

This is a discussion on simple questions within the C++ Programming forums, part of the General Programming Boards category; hay was wondering what VOID does? im really new to this and i cannot find the answer anywhere. if i ...

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    12

    simple questions

    hay was wondering what VOID does?
    im really new to this and i cannot find the answer anywhere.

    if i find any more simple questions like this ill reaply to this.

    thank you!

  2. #2
    Handy Andy andyhunter's Avatar
    Join Date
    Dec 2004
    Posts
    540
    Read this FAQ
    i don't think most standard compilers support programmers with more than 4 red boxes - Misplaced

    It is my sacred duity to stand in the path of the flood of ignorance and blatant stupidity... - quzah

    Such pointless tricks ceased to be interesting or useful when we came down from the trees and started using higher level languages. - Salem

  3. #3
    Registered User
    Join Date
    Feb 2005
    Posts
    12
    thx alot been wondering what it was for a long time!

  4. #4
    Registered User
    Join Date
    Feb 2005
    Posts
    12

    Question

    how would i execute only one block of code if a veriable equals a spacific number?

  5. #5
    Handy Andy andyhunter's Avatar
    Join Date
    Dec 2004
    Posts
    540
    You should take a look at this tutorial

    There are many useful things on this websites homepage.
    Last edited by andyhunter; 02-11-2005 at 02:55 PM. Reason: corrected typo
    i don't think most standard compilers support programmers with more than 4 red boxes - Misplaced

    It is my sacred duity to stand in the path of the flood of ignorance and blatant stupidity... - quzah

    Such pointless tricks ceased to be interesting or useful when we came down from the trees and started using higher level languages. - Salem

  6. #6
    Registered User
    Join Date
    Feb 2005
    Posts
    12
    ok so if i input script in the braces right after the if statement and such it will run the skript? ill try that and ill probly do it wrong lol

  7. #7
    Handy Andy andyhunter's Avatar
    Join Date
    Dec 2004
    Posts
    540
    Ok, if statements are used to executed sections of code based on whether a condition is evaluated as true or false. You use these as tools to help control the flow of a program. A very basic example of this is below. Note that the cout's are executed based on what input the user provided. The tutorial covers all of this, let me know if you need more help.

    Code:
    #include <iostream>
    
    using namespace std;
    
    int main() {
    
    	int x;
    
    	cout << "Enter either 1 or 2: ";
    	cin >> x;
    
    	if(x == 1){
    		cout << "This is only executed if x = 1";
    	}
    	if(x == 2){
    		cout << "This is only executed if x = 2";
    	}
    
    	cin.get();
    	cin.get();
    
    	return 0;
    }
    i don't think most standard compilers support programmers with more than 4 red boxes - Misplaced

    It is my sacred duity to stand in the path of the flood of ignorance and blatant stupidity... - quzah

    Such pointless tricks ceased to be interesting or useful when we came down from the trees and started using higher level languages. - Salem

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. questions....so many questions about random numbers....
    By face_master in forum C++ Programming
    Replies: 2
    Last Post: 07-30-2009, 08:47 AM
  2. A couple questions
    By Flakster in forum C++ Programming
    Replies: 7
    Last Post: 08-09-2005, 01:22 PM
  3. Few simple questions...
    By Shane in forum C++ Programming
    Replies: 9
    Last Post: 08-06-2005, 02:40 AM
  4. A few simple batch questions
    By sean in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 07-02-2003, 01:35 PM
  5. questions questions questions.....
    By mfc2themax in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 08-14-2001, 07:22 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21