As it is said in the title i can not get the keyword string. I finally found a version of C for windows 8 but now i can t get the most important thing types int, double char,bool ect... work perfectly and always show as a keyword but somehow i can not get string.

Recommended Answers

All 5 Replies

Is standard library present in your install?

it came with the package

C doesn't have a string type. Can you be more specific about what you're trying to do? Perhaps post a sample program?

I feel now kind of weird like my mind got erased in a second (started C at high school -.-) maybe because i m working in c# and now java for quite a time and suddenly switched to C and wondering where data type string is. Tnx @deceptikon

As deceptikon said, C language does not have a string data type. Instead, it uses character arrays. For example if you want it to hold the word "Hello" then the character array has to room to hold at least 6 characters -- 5 for "Hello" and another for the terminating character which is '\0';

char string[6];

This declares a character array named "string" that can hold 5 characters plus null-terminating character. You can name the array anything you want, it doesn't really matter as long as the name is unique (can't duplicate the name of something else in the program).

commented: tnx for the additional reply +3
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.