I'm a beginner myself, but is there really a bool type in C? I know there are libraries for it, but I don't see one included here.
Type: Posts; User: guraknugen
I'm a beginner myself, but is there really a bool type in C? I know there are libraries for it, but I don't see one included here.
Once again, thank you so much for doing all that work!
Got me… But now, when I looked a little at it, I realise that I probably should…
Hehehe… I'm not that big and I wouldn't call myself a...
I did some tests with your code above, and guess what… I have a couple of (newbie) questions…
It works, but I don't really understand the pointer-to-pointer thing in the widen function. In main,...
Wow, that was really a lot of great and useful information. Thanks a lot!
I searched yesterday for information about error handling and it seems like some people don't like the use of errno.h...
Oh, another one. The questions never end, it seems…
In my working example, the following is not good, is it?
for(int i=1; i<=2; i++)
printf("%ls\n", ToWide(argv[i]));
return...
Oh, sorry, one more question:
if(n > 0) {
c = mbstowcs(w, s, n + 1);
if(c != s) {
free(w);
/* s or locale was modified unexpectedly. Set errno? */
return NULL;...
My test program works fine now after following a selected amount of advice above… Made a few changes and everything works. After replacing %s with %ls and replacing ”*MyString” with ”Mystring”, the...
Okay, thanks. Again very useful information.
I am currently experimenting with this to correct a small, simple program that I wrote. The program counts characters and looks for characters in...
I think I remember why I did that now… I think my original idea was to send the whole argv to the function and let the function convert relevant parts of it to wide string, but then I abandoned that...
Yes, you're right. I didn't think of that.
Thanks, seems to be some nice details in there that I can learn from. When I studied C in the 1980's, wide strings didn't exist, at least we never...
Yes, I know all that, but what I was trying to say is that someone stated that printf and wprintf doesn't use the same letters, that is %s in wprintf does the same thing as %ls in printf. I don't...
For some reason this site is telling me that I need to lengthen this message with at least 4 characters, so here they are, and a few more… Well, I don't mind. If it asks for nonsense, I'll write...
Thanks for your reply. I'll give it another shot soon (quite busy this evening with other stuff).
Since I get the original string from argv[1] in this case, I don't know the maximum length of the...
Thank you for replying, I appreciate it very much.
Well, I already knew that I sent the wrong thing to the wprintf. My intention was that *MyString should contain, in your case, ”foo”, which it...
I'm not really sure what happens here. The problem is that I get a segmentation fault at the last wprintf at line 66 in my code below.
I'm obviously missing something that is probably obvious for...
#include <stdio.h>
int main(int argc, char *argv[])
{
unsigned int i=-100, j=-100;
// int i=-100, j=-100; ← This also works, for some reason…
for(int x=0; x<30; i+=8, x++) {...
Thanks! Works perfectly, even when I compile it as GNU99. I'm not sure exactly what the difference is, but I'm sure some things are…
I will learn a lot from this, I'm sure.
Thanks, that page gives me slightly more information than gnome-character-map.
Well, I'm not very interested in Windows, I left it behind in 2008 I think, but I enjoyed the link anyway…
That was actually one part of the whole thing that I didn't realise…! Thanks!
I'll reply to the other replies tomorrow, need some sleep now…
Funny. I have tried to find information about this for ∞ (almost…) and now when I finally ask for it on a forum I find the answer by just ”googling” for a few minutes…
I found this working...
I'm trying to understand how to write UTF-8 compatible C programs. I have seen that there are tons of text about it out there, maybe a little too much. It's hard to find exactly what I need to know...
That all make sense to me now. Thanks!
And yes, 100 % Linux here.
Of course, when there is an error, that much I understand. But what about these cases?
User doesn't know how to run the program, so he (or she) simply runs it without parameters to get...
Yes, you're right. I'll keep that in mind. Thanks.
I don't know where that came from. Obviously I wrote before thinking… I think I was thinking about another solution I had, not discussed in this thread…