printing characters stored in variables [duplicate]Char (single letter) must be a pointer to correctly work?Is an array name a pointer?Arrays are Pointers?What does this guide mean by “And since arrays are actually pointers”?Incompatible integer to pointer conversion assigning to 'char *' from 'int'Why is my program not compiling?Getting warnings when assigning characters to a 2d array declared using malloc in CInitialising integer array as memberVigénere Cipher in C+ or - sign in array, CIn C89, I can't seem to make a character array from an existing oneWhile executing this program the char function does the returning the variable.i dont know why?Why do I get this error and warning? Error and warning is in the description
C++ logging library
How to avoid typing 'git' at the begining of every git command
I have a problematic assistant manager, but I can't fire him
Why are MBA programs closing in the United States?
How do we say "within a kilometer radius spherically"?
Sci-fi novel: ark ship from Earth is sent into space to another planet, one man woken early from cryosleep paints a giant mural
What would prevent chimeras from reproducing with each other?
Teaching a class likely meant to inflate the GPA of student athletes
Live action TV show where High school Kids go into the virtual world and have to clear levels
Why is Na5 not played in this line of the French Defense, Advance Variation?
Getting UPS Power from One Room to Another
Solving ‘Null geometry…’ error during distance matrix operation?
A map of non-pathological topology?
How can I make 12 tone and atonal melodies sound interesting?
Was Self-modifying-code possible just using BASIC?
Grep Match and extract
Is using 'echo' to display attacker-controlled data on the terminal dangerous?
Analogy between an unknown in an argument, and a contradiction in the principle of explosion
Does the new finding on "reversing a quantum jump mid-flight" rule out any interpretations of QM?
Amplitude of a crest and trough in a sound wave?
Russian word for a male zebra
Why does this query, missing a FROM clause, not error out?
How to hide rifle during medieval town entrance inspection?
Increase speed altering column on large table to NON NULL
printing characters stored in variables [duplicate]
Char (single letter) must be a pointer to correctly work?Is an array name a pointer?Arrays are Pointers?What does this guide mean by “And since arrays are actually pointers”?Incompatible integer to pointer conversion assigning to 'char *' from 'int'Why is my program not compiling?Getting warnings when assigning characters to a 2d array declared using malloc in CInitialising integer array as memberVigénere Cipher in C+ or - sign in array, CIn C89, I can't seem to make a character array from an existing oneWhile executing this program the char function does the returning the variable.i dont know why?Why do I get this error and warning? Error and warning is in the description
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
This question already has an answer here:
Char (single letter) must be a pointer to correctly work?
1 answer
I can't get my function to print characters i have initialised and declared.
#include <stdio.h>
int main()
char letter1 ="i";
char letter2 ="n";
char letter3 ="C";
printf ("Programming %c%c %cn", letter1, letter2, letter3);
return 0;
I want it to display
"Programming in C"
using
printf ("Programming %c%c %cn", letter1, letter2, letter3);
I get the following error
main.c:4:8: warning: incompatible pointer to integer conversion
initializing 'char' with an expression of type 'char [2]' [-Wint-
conversion]
char letter1 ="i";
^
I haven't learn about pointers or anything yet, I'm used to simpler languages that just work. I am trying to go through an edX course but I find the quality to be poor and the pacing tedious.
Would be happy if you could help me out here and recommend me better resources for learning C
thanks
c
marked as duplicate by melpomene, Daniel Pryden, Antti Haapala
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Mar 24 at 21:04
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Char (single letter) must be a pointer to correctly work?
1 answer
I can't get my function to print characters i have initialised and declared.
#include <stdio.h>
int main()
char letter1 ="i";
char letter2 ="n";
char letter3 ="C";
printf ("Programming %c%c %cn", letter1, letter2, letter3);
return 0;
I want it to display
"Programming in C"
using
printf ("Programming %c%c %cn", letter1, letter2, letter3);
I get the following error
main.c:4:8: warning: incompatible pointer to integer conversion
initializing 'char' with an expression of type 'char [2]' [-Wint-
conversion]
char letter1 ="i";
^
I haven't learn about pointers or anything yet, I'm used to simpler languages that just work. I am trying to go through an edX course but I find the quality to be poor and the pacing tedious.
Would be happy if you could help me out here and recommend me better resources for learning C
thanks
c
marked as duplicate by melpomene, Daniel Pryden, Antti Haapala
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Mar 24 at 21:04
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
3
"i"is a string literal, you want character literals, which use a single quote'i': en.cppreference.com/w/c/language/character_constant
– UnholySheep
Mar 24 at 20:23
I didn't even know there was a difference, thanks it works now <3
– Mr_Bodger
Mar 24 at 20:24
Or changechartochar *and then doprintf ("Programming %c%c %cn", *letter1, *letter2, *letter3);(otherwise character literals use single-quotes while string literals use double-quotes)
– David C. Rankin
Mar 24 at 20:47
add a comment |
This question already has an answer here:
Char (single letter) must be a pointer to correctly work?
1 answer
I can't get my function to print characters i have initialised and declared.
#include <stdio.h>
int main()
char letter1 ="i";
char letter2 ="n";
char letter3 ="C";
printf ("Programming %c%c %cn", letter1, letter2, letter3);
return 0;
I want it to display
"Programming in C"
using
printf ("Programming %c%c %cn", letter1, letter2, letter3);
I get the following error
main.c:4:8: warning: incompatible pointer to integer conversion
initializing 'char' with an expression of type 'char [2]' [-Wint-
conversion]
char letter1 ="i";
^
I haven't learn about pointers or anything yet, I'm used to simpler languages that just work. I am trying to go through an edX course but I find the quality to be poor and the pacing tedious.
Would be happy if you could help me out here and recommend me better resources for learning C
thanks
c
This question already has an answer here:
Char (single letter) must be a pointer to correctly work?
1 answer
I can't get my function to print characters i have initialised and declared.
#include <stdio.h>
int main()
char letter1 ="i";
char letter2 ="n";
char letter3 ="C";
printf ("Programming %c%c %cn", letter1, letter2, letter3);
return 0;
I want it to display
"Programming in C"
using
printf ("Programming %c%c %cn", letter1, letter2, letter3);
I get the following error
main.c:4:8: warning: incompatible pointer to integer conversion
initializing 'char' with an expression of type 'char [2]' [-Wint-
conversion]
char letter1 ="i";
^
I haven't learn about pointers or anything yet, I'm used to simpler languages that just work. I am trying to go through an edX course but I find the quality to be poor and the pacing tedious.
Would be happy if you could help me out here and recommend me better resources for learning C
thanks
This question already has an answer here:
Char (single letter) must be a pointer to correctly work?
1 answer
c
c
asked Mar 24 at 20:21
Mr_BodgerMr_Bodger
141
141
marked as duplicate by melpomene, Daniel Pryden, Antti Haapala
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Mar 24 at 21:04
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by melpomene, Daniel Pryden, Antti Haapala
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Mar 24 at 21:04
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
3
"i"is a string literal, you want character literals, which use a single quote'i': en.cppreference.com/w/c/language/character_constant
– UnholySheep
Mar 24 at 20:23
I didn't even know there was a difference, thanks it works now <3
– Mr_Bodger
Mar 24 at 20:24
Or changechartochar *and then doprintf ("Programming %c%c %cn", *letter1, *letter2, *letter3);(otherwise character literals use single-quotes while string literals use double-quotes)
– David C. Rankin
Mar 24 at 20:47
add a comment |
3
"i"is a string literal, you want character literals, which use a single quote'i': en.cppreference.com/w/c/language/character_constant
– UnholySheep
Mar 24 at 20:23
I didn't even know there was a difference, thanks it works now <3
– Mr_Bodger
Mar 24 at 20:24
Or changechartochar *and then doprintf ("Programming %c%c %cn", *letter1, *letter2, *letter3);(otherwise character literals use single-quotes while string literals use double-quotes)
– David C. Rankin
Mar 24 at 20:47
3
3
"i" is a string literal, you want character literals, which use a single quote 'i': en.cppreference.com/w/c/language/character_constant– UnholySheep
Mar 24 at 20:23
"i" is a string literal, you want character literals, which use a single quote 'i': en.cppreference.com/w/c/language/character_constant– UnholySheep
Mar 24 at 20:23
I didn't even know there was a difference, thanks it works now <3
– Mr_Bodger
Mar 24 at 20:24
I didn't even know there was a difference, thanks it works now <3
– Mr_Bodger
Mar 24 at 20:24
Or change
char to char * and then do printf ("Programming %c%c %cn", *letter1, *letter2, *letter3); (otherwise character literals use single-quotes while string literals use double-quotes)– David C. Rankin
Mar 24 at 20:47
Or change
char to char * and then do printf ("Programming %c%c %cn", *letter1, *letter2, *letter3); (otherwise character literals use single-quotes while string literals use double-quotes)– David C. Rankin
Mar 24 at 20:47
add a comment |
2 Answers
2
active
oldest
votes
char letter1 ="i";
Unfortunately, "i" is a string. Use 'i' for characters or "i"[0] if you really want to.
If your compiler didn't give you a warning, it's either a terrible compiler or you don't have appropriate warnings turned on. If you got a warning and you ignored it ...
add a comment |
Arrays in C are pointers to the first element. All other elements in the array follows the first element on stack stack. Strings in C are represented by char arrays. Therefore, following example will work:
char str[3];
str[0] = 'A';
str[1] = 'B';
str[2] = 'C';
Fortunately, C allows a shorthand for representing strings. Following are two examples:
char str[] = "ABC";
char str* = "ABC";
As previously mentioned, arrays are pointers. Therefore, both examples work. Also, note that we don't have enter a size of the array as we directly initialize the array.
If you really want to print a string only using char variables, then you have to use quotes, like the example below:
letter1 = 'A';
letter2 = 'B';
letter3 = 'C';
As literature, I highly recommend the book Problem Solving and Program Design in C by Hanly Koffman. It is simple to read and has a lot of code examples.
1
Arrays are not pointers
– Blastfurnace
Mar 24 at 22:36
As I said, an array is a pointer to the first element.
– Martin Pekár
Mar 25 at 8:09
Arrays are not, in fact, pointers. For example, given the definitionschar arr[1], *ptr;it's a fact thatsizeof(arr) != sizeof(ptr)andarr = ptr;is a syntax error. The array and the pointer are not the same types. I can find more questions/answers on Stack Overflow if you aren't convinced.
– Blastfurnace
Mar 25 at 8:37
Well, sizeof in C will return the amount of bytes for the data types times amount of element in the array. So, of course, they are not equal, since you have to get the address of an element in the array and compare its address size to the size of the pointer. And yes, ´arr=ptr´ is a syntax error, but the opposite ´ptr=arr´ is not. Technicallly, an array of a compile time specific size is allocated in the %rsp register, which is then pushed onto the stack. An array is a pointer to the first element in the %rsp register. To get the next element on the stack, add the byte size to the address.
– Martin Pekár
Mar 25 at 10:52
Also, why do you dynamically allocate memory in a pointer...?
– Martin Pekár
Mar 25 at 10:57
|
show 7 more comments
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
char letter1 ="i";
Unfortunately, "i" is a string. Use 'i' for characters or "i"[0] if you really want to.
If your compiler didn't give you a warning, it's either a terrible compiler or you don't have appropriate warnings turned on. If you got a warning and you ignored it ...
add a comment |
char letter1 ="i";
Unfortunately, "i" is a string. Use 'i' for characters or "i"[0] if you really want to.
If your compiler didn't give you a warning, it's either a terrible compiler or you don't have appropriate warnings turned on. If you got a warning and you ignored it ...
add a comment |
char letter1 ="i";
Unfortunately, "i" is a string. Use 'i' for characters or "i"[0] if you really want to.
If your compiler didn't give you a warning, it's either a terrible compiler or you don't have appropriate warnings turned on. If you got a warning and you ignored it ...
char letter1 ="i";
Unfortunately, "i" is a string. Use 'i' for characters or "i"[0] if you really want to.
If your compiler didn't give you a warning, it's either a terrible compiler or you don't have appropriate warnings turned on. If you got a warning and you ignored it ...
answered Mar 24 at 20:25
David SchwartzDavid Schwartz
141k14149237
141k14149237
add a comment |
add a comment |
Arrays in C are pointers to the first element. All other elements in the array follows the first element on stack stack. Strings in C are represented by char arrays. Therefore, following example will work:
char str[3];
str[0] = 'A';
str[1] = 'B';
str[2] = 'C';
Fortunately, C allows a shorthand for representing strings. Following are two examples:
char str[] = "ABC";
char str* = "ABC";
As previously mentioned, arrays are pointers. Therefore, both examples work. Also, note that we don't have enter a size of the array as we directly initialize the array.
If you really want to print a string only using char variables, then you have to use quotes, like the example below:
letter1 = 'A';
letter2 = 'B';
letter3 = 'C';
As literature, I highly recommend the book Problem Solving and Program Design in C by Hanly Koffman. It is simple to read and has a lot of code examples.
1
Arrays are not pointers
– Blastfurnace
Mar 24 at 22:36
As I said, an array is a pointer to the first element.
– Martin Pekár
Mar 25 at 8:09
Arrays are not, in fact, pointers. For example, given the definitionschar arr[1], *ptr;it's a fact thatsizeof(arr) != sizeof(ptr)andarr = ptr;is a syntax error. The array and the pointer are not the same types. I can find more questions/answers on Stack Overflow if you aren't convinced.
– Blastfurnace
Mar 25 at 8:37
Well, sizeof in C will return the amount of bytes for the data types times amount of element in the array. So, of course, they are not equal, since you have to get the address of an element in the array and compare its address size to the size of the pointer. And yes, ´arr=ptr´ is a syntax error, but the opposite ´ptr=arr´ is not. Technicallly, an array of a compile time specific size is allocated in the %rsp register, which is then pushed onto the stack. An array is a pointer to the first element in the %rsp register. To get the next element on the stack, add the byte size to the address.
– Martin Pekár
Mar 25 at 10:52
Also, why do you dynamically allocate memory in a pointer...?
– Martin Pekár
Mar 25 at 10:57
|
show 7 more comments
Arrays in C are pointers to the first element. All other elements in the array follows the first element on stack stack. Strings in C are represented by char arrays. Therefore, following example will work:
char str[3];
str[0] = 'A';
str[1] = 'B';
str[2] = 'C';
Fortunately, C allows a shorthand for representing strings. Following are two examples:
char str[] = "ABC";
char str* = "ABC";
As previously mentioned, arrays are pointers. Therefore, both examples work. Also, note that we don't have enter a size of the array as we directly initialize the array.
If you really want to print a string only using char variables, then you have to use quotes, like the example below:
letter1 = 'A';
letter2 = 'B';
letter3 = 'C';
As literature, I highly recommend the book Problem Solving and Program Design in C by Hanly Koffman. It is simple to read and has a lot of code examples.
1
Arrays are not pointers
– Blastfurnace
Mar 24 at 22:36
As I said, an array is a pointer to the first element.
– Martin Pekár
Mar 25 at 8:09
Arrays are not, in fact, pointers. For example, given the definitionschar arr[1], *ptr;it's a fact thatsizeof(arr) != sizeof(ptr)andarr = ptr;is a syntax error. The array and the pointer are not the same types. I can find more questions/answers on Stack Overflow if you aren't convinced.
– Blastfurnace
Mar 25 at 8:37
Well, sizeof in C will return the amount of bytes for the data types times amount of element in the array. So, of course, they are not equal, since you have to get the address of an element in the array and compare its address size to the size of the pointer. And yes, ´arr=ptr´ is a syntax error, but the opposite ´ptr=arr´ is not. Technicallly, an array of a compile time specific size is allocated in the %rsp register, which is then pushed onto the stack. An array is a pointer to the first element in the %rsp register. To get the next element on the stack, add the byte size to the address.
– Martin Pekár
Mar 25 at 10:52
Also, why do you dynamically allocate memory in a pointer...?
– Martin Pekár
Mar 25 at 10:57
|
show 7 more comments
Arrays in C are pointers to the first element. All other elements in the array follows the first element on stack stack. Strings in C are represented by char arrays. Therefore, following example will work:
char str[3];
str[0] = 'A';
str[1] = 'B';
str[2] = 'C';
Fortunately, C allows a shorthand for representing strings. Following are two examples:
char str[] = "ABC";
char str* = "ABC";
As previously mentioned, arrays are pointers. Therefore, both examples work. Also, note that we don't have enter a size of the array as we directly initialize the array.
If you really want to print a string only using char variables, then you have to use quotes, like the example below:
letter1 = 'A';
letter2 = 'B';
letter3 = 'C';
As literature, I highly recommend the book Problem Solving and Program Design in C by Hanly Koffman. It is simple to read and has a lot of code examples.
Arrays in C are pointers to the first element. All other elements in the array follows the first element on stack stack. Strings in C are represented by char arrays. Therefore, following example will work:
char str[3];
str[0] = 'A';
str[1] = 'B';
str[2] = 'C';
Fortunately, C allows a shorthand for representing strings. Following are two examples:
char str[] = "ABC";
char str* = "ABC";
As previously mentioned, arrays are pointers. Therefore, both examples work. Also, note that we don't have enter a size of the array as we directly initialize the array.
If you really want to print a string only using char variables, then you have to use quotes, like the example below:
letter1 = 'A';
letter2 = 'B';
letter3 = 'C';
As literature, I highly recommend the book Problem Solving and Program Design in C by Hanly Koffman. It is simple to read and has a lot of code examples.
answered Mar 24 at 20:42
Martin PekárMartin Pekár
274
274
1
Arrays are not pointers
– Blastfurnace
Mar 24 at 22:36
As I said, an array is a pointer to the first element.
– Martin Pekár
Mar 25 at 8:09
Arrays are not, in fact, pointers. For example, given the definitionschar arr[1], *ptr;it's a fact thatsizeof(arr) != sizeof(ptr)andarr = ptr;is a syntax error. The array and the pointer are not the same types. I can find more questions/answers on Stack Overflow if you aren't convinced.
– Blastfurnace
Mar 25 at 8:37
Well, sizeof in C will return the amount of bytes for the data types times amount of element in the array. So, of course, they are not equal, since you have to get the address of an element in the array and compare its address size to the size of the pointer. And yes, ´arr=ptr´ is a syntax error, but the opposite ´ptr=arr´ is not. Technicallly, an array of a compile time specific size is allocated in the %rsp register, which is then pushed onto the stack. An array is a pointer to the first element in the %rsp register. To get the next element on the stack, add the byte size to the address.
– Martin Pekár
Mar 25 at 10:52
Also, why do you dynamically allocate memory in a pointer...?
– Martin Pekár
Mar 25 at 10:57
|
show 7 more comments
1
Arrays are not pointers
– Blastfurnace
Mar 24 at 22:36
As I said, an array is a pointer to the first element.
– Martin Pekár
Mar 25 at 8:09
Arrays are not, in fact, pointers. For example, given the definitionschar arr[1], *ptr;it's a fact thatsizeof(arr) != sizeof(ptr)andarr = ptr;is a syntax error. The array and the pointer are not the same types. I can find more questions/answers on Stack Overflow if you aren't convinced.
– Blastfurnace
Mar 25 at 8:37
Well, sizeof in C will return the amount of bytes for the data types times amount of element in the array. So, of course, they are not equal, since you have to get the address of an element in the array and compare its address size to the size of the pointer. And yes, ´arr=ptr´ is a syntax error, but the opposite ´ptr=arr´ is not. Technicallly, an array of a compile time specific size is allocated in the %rsp register, which is then pushed onto the stack. An array is a pointer to the first element in the %rsp register. To get the next element on the stack, add the byte size to the address.
– Martin Pekár
Mar 25 at 10:52
Also, why do you dynamically allocate memory in a pointer...?
– Martin Pekár
Mar 25 at 10:57
1
1
Arrays are not pointers
– Blastfurnace
Mar 24 at 22:36
Arrays are not pointers
– Blastfurnace
Mar 24 at 22:36
As I said, an array is a pointer to the first element.
– Martin Pekár
Mar 25 at 8:09
As I said, an array is a pointer to the first element.
– Martin Pekár
Mar 25 at 8:09
Arrays are not, in fact, pointers. For example, given the definitions
char arr[1], *ptr; it's a fact that sizeof(arr) != sizeof(ptr) and arr = ptr; is a syntax error. The array and the pointer are not the same types. I can find more questions/answers on Stack Overflow if you aren't convinced.– Blastfurnace
Mar 25 at 8:37
Arrays are not, in fact, pointers. For example, given the definitions
char arr[1], *ptr; it's a fact that sizeof(arr) != sizeof(ptr) and arr = ptr; is a syntax error. The array and the pointer are not the same types. I can find more questions/answers on Stack Overflow if you aren't convinced.– Blastfurnace
Mar 25 at 8:37
Well, sizeof in C will return the amount of bytes for the data types times amount of element in the array. So, of course, they are not equal, since you have to get the address of an element in the array and compare its address size to the size of the pointer. And yes, ´arr=ptr´ is a syntax error, but the opposite ´ptr=arr´ is not. Technicallly, an array of a compile time specific size is allocated in the %rsp register, which is then pushed onto the stack. An array is a pointer to the first element in the %rsp register. To get the next element on the stack, add the byte size to the address.
– Martin Pekár
Mar 25 at 10:52
Well, sizeof in C will return the amount of bytes for the data types times amount of element in the array. So, of course, they are not equal, since you have to get the address of an element in the array and compare its address size to the size of the pointer. And yes, ´arr=ptr´ is a syntax error, but the opposite ´ptr=arr´ is not. Technicallly, an array of a compile time specific size is allocated in the %rsp register, which is then pushed onto the stack. An array is a pointer to the first element in the %rsp register. To get the next element on the stack, add the byte size to the address.
– Martin Pekár
Mar 25 at 10:52
Also, why do you dynamically allocate memory in a pointer...?
– Martin Pekár
Mar 25 at 10:57
Also, why do you dynamically allocate memory in a pointer...?
– Martin Pekár
Mar 25 at 10:57
|
show 7 more comments
3
"i"is a string literal, you want character literals, which use a single quote'i': en.cppreference.com/w/c/language/character_constant– UnholySheep
Mar 24 at 20:23
I didn't even know there was a difference, thanks it works now <3
– Mr_Bodger
Mar 24 at 20:24
Or change
chartochar *and then doprintf ("Programming %c%c %cn", *letter1, *letter2, *letter3);(otherwise character literals use single-quotes while string literals use double-quotes)– David C. Rankin
Mar 24 at 20:47