have asked for that but i got somewhat holes im my memory and i
dont exactly remember sometimes on which i wrote and on which not
the problem is i need this adhos enums strongly and really, but those
'smth' are to shore i could use two of them f('some','thin') but it gets >uglier and such code is like degraded
in fact there could be quite easy solution - it is use string literals
as such tags - i mean you dont need to use strcomp , you just need to
have same string literals have same pointer then
if("cat" == "cat") will return true and
if("cat" == "dog") will return false
i probably asked that but if so once again
is there way to enforce it to work?
On Sat, 10 Oct 2026 23:02:54 +0200, fir
have asked for that but i got somewhat holes im my memory and i
dont exactly remember sometimes on which i wrote and on which not
the problem is i need this adhos enums strongly and really, but those
'smth' are to shore i could use two of them f('some','thin') but it gets
uglier and such code is like degraded
in fact there could be quite easy solution - it is use string literals
as such tags - i mean you dont need to use strcomp , you just need to
have same string literals have same pointer then
if("cat" == "cat") will return true and
if("cat" == "dog") will return false
I say if int is 4 chars this should return 1 in case of fist line
0 in case the second line
if((*(int*)"cat") == (*(int*)"cat")) return 1
if((*(int*)"cat") == (*(int*)"dog") ) return 0
otherwise there is a need one function that from the pointer check
strings are ugual as strcmp
I think can be too
strcpy(char* a, char* b)
{
if(a==b) return 0;
}
but who is sure a and b point a to 2 strings?
i probably asked that but if so once again
is there way to enforce it to work?
On 2026-10-15 11:36, Rosario19 wrote:
On Sat, 10 Oct 2026 23:02:54 +0200, fir
have asked for that but i got somewhat holes im my memory and i
dont exactly remember sometimes on which i wrote and on which not
the problem is i need this adhos enums strongly and really, but those
'smth' are to shore i could use two of them f('some','thin') but it gets >>> uglier and such code is like degraded
in fact there could be quite easy solution - it is use string literals
as such tags - i mean you dont need to use strcomp , you just need to
have same string literals have same pointer then
if("cat" == "cat") will return true and
if("cat" == "dog") will return false
I say if int is 4 chars this should return 1 in case of fist line
0 in case the second line
if((*(int*)"cat") == (*(int*)"cat")) return 1
if((*(int*)"cat") == (*(int*)"dog") ) return 0
You are seriously suggesting that the semantics of "C" should
depend on the actual string-length at runtime, that it should
not have an unambiguous uniform semantics in the first place?
Janis
| Sysop: | DaiTengu |
|---|---|
| Location: | Appleton, WI |
| Users: | 1,142 |
| Nodes: | 10 (0 / 10) |
| Uptime: | 135:29:47 |
| Calls: | 14,707 |
| Calls today: | 1 |
| Files: | 186,498 |
| D/L today: |
1,120 files (344M bytes) |
| Messages: | 2,552,863 |