This simple program will count characters for you!!
#include <stdio.h>
int main()
{
printf(" = %d characters", printf("Hello World!"));
return 0;
}
DMZ wrote this copyrighted missive and expects royalties:
This simple program will count characters for you!!
#include <stdio.h>
int main()
{
printf(" = %d characters", printf("Hello World!"));
return 0;
}
Cute.
Am 14.09.2024 um 21:41 schrieb Chris Ahlstrom:
DMZ wrote this copyrighted missive and expects royalties:
This simple program will count characters for you!!
#include <stdio.h>
int main()
{
printf(" = %d characters", printf("Hello World!"));
return 0;
}
Cute.
Nice, but this counts the characters at compile-time:
std::string_view sv( "Hello World!" );
std::cout << sv << " = " << sv.length() << " characters" << endl;
Am 16.09.2024 um 18:08 schrieb Muttley@dastardlyhq.com:
On Mon, 16 Sep 2024 17:55:02 +0200
Bonita Montero <Bonita.Montero@gmail.com> boringly babbled:
Am 14.09.2024 um 21:41 schrieb Chris Ahlstrom:
DMZ wrote this copyrighted missive and expects royalties:
This simple program will count characters for you!!
#include <stdio.h>
int main()
{
printf(" = %d characters", printf("Hello World!"));
return 0;
}
Cute.
Nice, but this counts the characters at compile-time:
std::string_view sv( "Hello World!" );
std::cout << sv << " = " << sv.length() << " characters" << endl;
So does sizeof("Hello world!");
But sizeof(string_literal) includes the null-terminating character.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 496 |
Nodes: | 16 (2 / 14) |
Uptime: | 55:02:08 |
Calls: | 9,759 |
Calls today: | 19 |
Files: | 13,742 |
Messages: | 6,185,116 |