Half a croissant, on a plate, with a sign in front of it saying '50c'
h a l f b a k e r y
Nice swing,
no follow-through.

idea: add, search, annotate, link, view, overview, recent, by name, random

meta: news, help, about, links, report a problem

account: browse anonymously, or get an account and write.

user:
pass:
register,


     

single quote in C could mean char array, not just single char

 
(0)
  [vote for,
against]

At the moment

"a" --> 'a', '\n' : Valid C

'a' --> 'a' : Valid C

But 'ab` is invalid

'ab' ---> INVALID C

---------

This seems a bit inconvenient if you want to write printable character without a null terminator.

What would be nice is if you are allowed to type this

'subsys_3' ---> {'s','u','b','s','y','s','_','3'}

mofosyne, Jun 30 2017

Please log in.
If you're not logged in, you can see what this page looks like, but you will not be able to add anything.
Short name, e.g., Bob's Coffee
Destination URL. E.g., https://www.coffee.com/
Description (displayed with the short name and URL.)






       To write a string without a null terminator, just specify the array length; if there's no room for the terminator, it'll be omitted. Dress it up in a macro if you want it to be more maintainable:   

       char variable[8] = "subsys_3";
Wrongfellow, Jun 30 2017
  

       Well, at least it's not in {other} ' general;
normzone, Jun 30 2017
  


 

back: main index

business  computer  culture  fashion  food  halfbakery  home  other  product  public  science  sport  vehicle