Question:
in which language it is faster to access the string (among C and Pascal)?
Amitesh Purohit
2013-08-04 23:03:22 UTC
In C we have string terminated with '\0' ,while in Pascal a leading byte is used to store the length.
which one is faster to access the string. WHY?
C example [A M I T E S H \0]
PASCAL example [7 A M I T E S H]
Three answers:
2013-08-04 23:47:10 UTC
Actions that involves the string length could be faster in Pascal because it has the string length ready to use whereas C has to iterate over the string to find the end and calculate the length by subtracting the beginning from the end of the string. Everything else is probably faster in C.
?
2013-08-05 12:05:31 UTC
C language
Sachin
2013-08-05 06:08:06 UTC
\\\C\\\


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...