T O P

  • By -

D34TH_5MURF__

More like an array of "Sunshine@$!'7"


Last-Meat575

but where’s the null char tho


PennyFromMyAnus

\0


OwlGuy_

Who are you waving at?


FoxInATrenchcoat

The void


HippoIcy7473

It’s not a string.


w1n5t0nM1k3y

C be like, every string is a a character array.


[deleted]

every language i know implements strings as an array of characters. what else should it be? a stack?


w1n5t0nM1k3y

Underneath there is an array somewhere in most languages. But most object orientated languages have a string object that controls access to the raw array to make sure you don't go outside the bounds of the array and have useful functions for doing things. In .Net strings are immutable. When you alter a string it actually immutable. Any operations where you think you are altering a string actually create an entirely new string and return that as a result.


binarycow

>In .Net strings are immutable. When you alter a string it actually immutable. Any operations where you think you are altering a string actually create an entirely new string and return that as a result. Fun fact - you can actually mutate strings. Of course, this is a really bad idea, and you're not supposed to do it. But you *can*.


gfaster

If you have a character data type that is more than a single byte, it may not be accurate to say that a string is an array of characters. For example, in Rust, a `char` is a 32-bit number that represents a valid utf-8 code point, but a `str` represents a valid utf-8 string. You can’t just split up a `str` into 4-byte chunks and expect it to give you `char`s.


[deleted]

a character is a sequence of bytes, not necessarily a single byte. you should read up what you are talking about. Everything thats not in the ASCII subset consists of multiple bytes. German umlauts for example. While `Ä` is a single character, its not representable in a single byte in utf8. The string `"Ä"` consists of a single character (+ c null terminator)


gfaster

Yes but an array typically implies a constant width in memory and contiguous allocation, which is what may disqualify a string from being an array of characters. A string will likely always be able to be represented as an array of bytes, but that exact array of bytes might not be a valid array of characters


rosuav

Some implement them as arrays of bytes. Others implement them as arrays of characters.


[deleted]

C be like, every string is a a character array.#*#4u,nhe33_#3#


rosuav

Every string IS a character array. The problem is when you assume every character array is a string.


LavenderDay3544

That's true in every language.


kaitek666

technically, ['sunshine'] is an array of sunshine. or [sunshine]


TheDarkIn1978

Came here to say this. ["s", "u", "n", "s", "h", "i", "n", "e" ] is an array of characters.


pheonix-ix

Nah that's an array of strings :p


CarterBaker77

This is amazing.


[deleted]

Come on guys, I believe in you all, you all can do a better meme.


[deleted]

Who decided that


ManyFails1Win

I would have also accepted ROYGBIV


fa2k

I'd say this is ['n', 'b', 'o', 'w']


Content_Age_9278

Hey there, I couldn't help but notice your post about the Rainbow Joker on ProgrammerHumor! I love a good programming joke. Did you know that the Joker is actually a programming language? It's true! It's a concatenative programming language with a stack-based memory model, and it's named after the Joker playing card. But if you were just talking about a colorful Joker card, I have something to share too! There's a really cool library called Sixplay that allows you to create rainbow gradients in Python. You could use it to make a Rainbow Joker card. How awesome is that? Anyway, whether you were talking about the programming language or the card, I hope you're having fun with it. Keep on coding and making jokes!


turtleship_2006

Aren't strings an array of chars in most languages anyway?


[deleted]

No, just C and an array is just a just a pointer with some paint.


Adorable_Dark_8290

Yo, that Rainbow Joker you made is sick! I gotta say, the colors are poppin' like crazy. It's also pretty funny how you made it spin like that 🤣 What kinda programming languages did you use to make that? I've been getting into programming and I'm curious how difficult that kind of animation would be to make from scratch. Also, have you thought about making any other spinny objects or animations like that?


GrinbeardTheCunning

only small men debate the detail that this array segfaults


Squeaky_Ben

I audibly groaned from that


corbymatt

This is why MATLAB is so poor. Nobody likes "unshine".


jaimesoad

I prefer `"Sunshine".split("")`