Blockland Forums > General Discussion

print "Hello World!"

Pages: << < (14/16) > >>

Blockzillahead:


--- Quote from: $trinick on February 26, 2014, 11:50:40 PM ---but that's okay there are plenty of languages like JavaScript that would be happy to convert everything to any variable type automatically without asking you.

--- End quote ---
you can use "auto" in c++ too

Pacnet:

 I still don't get the point of using printf instead of the std::cout stream.
Both have positives and negatives but-


* iostream is built from a class so it's inheritable
* Less likely to cause errors
* Typesafe: Doesn't need you to define the variable type because the compiler detects it automatically
* cout improves readability of code
* You don't have to memorize the % values for each variable type,
* printf was designed for C and many programmers prefer cout for C++
* Usually, speed isn't so important that you would want to use printf instead.
* cout has useful member methods such as cout.setState
it's true that printf is usually faster, but how often does that actually matter...?

$trinick:


--- Quote from: Blockzillahead on February 27, 2014, 09:59:39 PM ---you can use "auto" in c++ too

--- End quote ---

Dune: yeah its probably bad practice to use auto
Jailbot - RIP HPRC: im pretty sure it is extremely poor practice to use the auto keyword


We concur that using auto is a horrible practice. Please promptly remove any instances of this from your code.

blueblur121:


--- Code: ---#include<iostream>
using namespace std;

int main() {
   cout << "Do I win yet?" << endl;
   return 0;
}

--- End code ---


Yin Yang:


--- Quote from: ßlöükfáce on February 26, 2014, 11:05:09 PM ---y'all are big fat NERDS

--- End quote ---


--- Code: ---#include <iostream>

class Gardian{
public:
int awesomeness = 9999;
int buildingSkill = 5; //out of 10
int eventingSkill = 9; //out of 10
int blocklandScriptingSkill = 2; //out- you get it
int modelingSkill = 4;
int codingSkill = 5;

};

int Response(int knowledgeOnSubject, char user, int inputmessage){
Gardian Gardian;
char Response[]= CreateResponce(Gardian.awesomeness, Gardian.buildingSkill, Gardian.eventingSkill, Gardian.blocklandScriptingSkill, Gardian.modelingSkill, Gardian.codingSkill, knowledgeOnSubject, user, inputmessage);
}

int main(){
    char topic[100];
    char user[50];
    char inputmessage[300];
  
    cin >> topic;
    cin >> user;
    cin >> inputmessage;
    

    int knowledgeOnSubject = GetKOS(topic, user); //Knowledge on subject
    
    char Response[] = Response(knowledgeOnSubject, user, inputmessage);

    createForumPost(Response[]);
}
--- End code ---

--- Code: -----Run--

<  print "Hello World!"
<  ßlöükfáce
<  y'all are big fat NERDS

...Thinking...

--- End code ---

> forget you.

how funny was this?  */10

Pages: << < (14/16) > >>

Go to full version