You are not logged in. Please login at to post your questions!


I've read that the following is the fastest method for accepting integers, can someone please tell me a little about its delimiters.

void fastscan(int &number) {

//variable to indicate sign of input number

bool negative = false;

register int c;

number = 0;

// extract current character from buffer

c = getchar();

if (c=='-')


    // number is negative

    negative = true;

    // extract the next character from the buffer

    c = getchar();


asked 07 Nov '18, 20:42

karan26122001's gravatar image

accept rate: 0%

toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 07 Nov '18, 20:42

question was seen: 286 times

last updated: 07 Nov '18, 20:42