• Cursos
  • Compilador de Código
  • Discutir
  • Preços
  • Teams
Menu
0

Difference between size and length in c++ for string?

string a,b; a.length a.size() what is the diffference between these two

c++stringdifferencea.lengtha.size()
14th Dec 2017, 2:23 PM
Frankestine Stine
Frankestine Stine - avatar
2 Respostas
+ 2
They are synonyms for each other. Same function per the documentation. http://en.cppreference.com/w/cpp/string/basic_string http://en.cppreference.com/w/cpp/string/basic_string/size
14th Dec 2017, 3:17 PM
ChaoticDawg
ChaoticDawg - avatar
+ 1
quite similar
14th Dec 2017, 2:34 PM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar

Costuma ter perguntas como essa?

Aprenda de maneira mais eficiente, de graça:

  • Introdução ao Python

    7.1M de alunos

  • Introdução ao Java

    4.7M de alunos

  • Introdução ao C

    1.5M alunos

  • Introdução ao HTML

    7.5M alunos

Ver todos os cursos
Quente hoje
Hello World!
0 Votes
What is wrost mistake that mostly people made while learning coding?
0 Votes
I'm lost with JavaScript (document.getElementById(".") And clearly making mistakes, Can someone help, I thought I had it but no.
0 Votes
What’s the actual difference between MB and GB in real-world usage?
1 Votes
Script file names
0 Votes
How to put multiple inputs in python?
1 Votes
Html learn
1 Votes
Je cherche des gens qui parle français pour apprendre le langage c
0 Votes
What can I do after learning python and how to create amazing codes. And how many times it would take to be a good programmer😅
0 Votes
I wish Ruby back in the course list
1 Votes