- This topic is empty.
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
Software programming learning aide
CS50 threads to aide as a supplementary resource › Forums › CS50’s Introduction to Computer Science by Harvard University on Edx › Week 2 › Converting string to character for counting number of characters
Tagged: arrays, c, get_string(), scrabble lab problem, string type, strlen
#include <stdio.h>
#include <cs50.h>
int main(void)
{
string enterword = get_string("input");
printf("enterword %s", enterword);
}
After taking input text that user enters, I intend to count no. of characters. Since initially the user enters string type, it appears that I need to convert string type to char type. After that, count no. of characters by a temporary counter variable.
Help appreciated how to convert string type to character type.
Reply
https://edstem.org/us/courses/176/discussion/951606?comment=2159746[learn_press_profile]