News for hackers. Stuff that matters.
Re:Teaching C by ryao on Tuesday May 10, 2016 @09:11PM (#11671966)
Copying a string by doing x = y is rare among languages. Most copy references like C does. An example of an outlier that does a string copy like you want would be C++ on its string class.

You can copy/initialize strings in C without ever writing a single loop by using strcpy. As for hardware, you need not have something so exotic. x86 for instance has a string copy instruction. The C strcpy function is often compiled to it.

Re:Teaching C by ejanus on Thursday May 12, 2016 @03:28AM (#11681920)
Is strcpy not implemented with a loop?