Turbo C

R

Riyad

Hi,
I'm a student of IUT.
My question is - "What is string constant?"

Any reply will be appreciated.

Hasib
091441
MCE
 
R

Rob Kendrick

Hi,
I'm a student of IUT.
My question is - "What is string constant?"

Any reply will be appreciated.

Sure about that? I see lots of IUT students posting elementary
questions, lots of abuse and advice to sue their teaching establishment
thrown at them, and then no follow up from the students at all.

B,
 
N

Noob

Riyad said:
Hi,
I'm a student of IUT.
My question is - "What is string constant?"

Any reply will be appreciated.

Could you add "IUT" in the subject of any similar future messages?

They'll be easier to kill-file.
 
M

Malcolm McLean

Hi,
I'm a student of IUT.
My question is - "What is string constant?"
The correct term is "string literal". It is any string embedded in
double quotes in a C source file.
 
P

Phil Carmody

Richard Heathfield said:

Only partly

char *what="what";
char wot[]="wot?";
wot[2]='u';

One of the strings is indeed constant, but the other one varies,
so not all strings are constant.

Phil
 
K

Keith Thompson

Heikki Kallasjoki said:
#include "not_a_string_literal_either.h"

(It seems to be a "header name" instead.)

char s[] = { '"'/* neither is this */, '"' };

char c = '"also not a string literal"';

#include <header_with_"quotes"_in_its_name.h>

Note to IUT students: Do not attempt to learn from this discussion.
Open your text book or ask your instructor.
 
P

Phil Carmody

Richard Heathfield said:
Phil said:
Richard Heathfield said:
Riyad wrote:
Hi,
I'm a student of IUT.
My question is - "What is string constant?"
Correct.

Only partly

char *what="what";
char wot[]="wot?";
wot[2]='u';

One of the strings is indeed constant, but the other one varies,

No, the content of one element in the 'wot' array varies.

The wot array does contain precisely a contiguous sequence of
characters terminated by, and including, a null character. We
have a short hand term for objects that have that property.
Whoever said they were?

Perhaps a smiley was required...

Him: What, is string constant?
You: Correct.
Me: No - not all string constant!

I program C very well - I learn it from a book!

Phil
 
P

Phil Carmody

Richard Heathfield said:
If he'd actually said that, your response might have been amusing. As
it was, he didn't, and so it wasn't obvious that you intended a joke.

What he wrote wasn't strictly correct English. _All_ interpretations
of it required modifying it in some way, even yours. Mote, dear boy.

Phil
 
P

Phil Carmody

Richard Heathfield said:
It looks fine to me (thanks to the Use-Mention Distinction).

The thing that he mentioned was something he wrote too. And it's
not strictly correct English. Stop trying to be clever.
I suppose
you may have spotted a fine point of English language law that I've
overlooked, but tell me this: how are those Urdu lessons coming along?

I really can't be arsed to look up which logical fallacy that
misdirection is.

Phil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Turbo c 1
Turbo C 5
Structures 0
C programming 12
Turbo C 3
Turbo C 1
Structure and Union 1
Turbo C 1

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,147
Latest member
CarenSchni
Top