Ask Your Question
0

How to declare strings in C using Pascal-style syntax?

asked 2022-12-26 11:00:00 +0000

lakamha gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2022-06-05 16:00:00 +0000

djk gravatar image

In C, strings can be declared using Pascal-style syntax as:

char* s = "string";

This declares a character pointer s and initializes it with a string literal "string". This string literal is represented as an array of characters terminated by a null character (\0).

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-12-26 11:00:00 +0000

Seen: 16 times

Last updated: Jun 05 '22