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 [email protected]:
On Mon, 16 Sep 2024 17:55:02 +0200
Bonita Montero <[email protected]> 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: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 157:17:30 |
| Calls: | 12,093 |
| Calls today: | 1 |
| Files: | 15,000 |
| Messages: | 6,517,750 |