C Programming Tutorial - 32 - A Few Cool Character Functions

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

ASCII is the system used to link numbers to characters, allowing you to use them interchangably. UTF-8, which is the system we now use, includes ASCII. If you're interested in learning more about this stuff, ASCII is the keyword you're looking for

SincerelyVince
Автор

u r talented bro, i got much from your tuna tutorial lol

lovemakehurts
Автор

Switch maybe confused with "if....greatwork mr

barasanathan
Автор

why cant they have algebra classes like this.... with syntax n all.

thestalks
Автор

In some of the other tutorials that I was watching about programming on youtube they used cout instead of printf and cin instead of scanf.
do they both do the same thing?

abdullahkhalid
Автор

SO important to get this down lmao C can be the dumbest or smartest language depending on the and thats why I still refer back to these vids, cause im a dummy.

dakadoodle
Автор

Okay, so I wanted to spice things up a bit by actually asking the user for an input using scanf. It compiled successfully, and it also ran. But whenever I give 55, let's say it says its a digit. But in the same program if i give a letter it says "J is an alphabet"
Anyway, here's my code
Is there a way to fix it? So that, when I give lets say a number 5 it will say '' 5 is a digit' and when i input "a" it'll say, '"a is an alphabet" simultaneously?

int main()
{
int x;
printf("**Digits and Integer Separator** \n");
printf("Enter digit/number: ");
scanf(" %d", &x);

if(isalpha(x))
{

printf("\n %c is an alphabet \n", x);
}
else
{
if(isdigit(x))
{

printf(" %d is a digit \n", x);

}
else
{
printf(" Unknown \n ");
}
return 0;
}

shaikhrezwanrafidahmad
Автор

When using codeblocks, i am able to compile and run programs without the return statement in the main method as well as leaving out all preprocessor files. Why?

volo
Автор

tuna bacon tuna bacon tuna bacon :P
bwahahahahahahahahahahahaha :P
u rock :3

farheendewan
Автор

if they can be used interchangeably why when we type %d instead of %c for testing a digit, for example for int tuna='7', the answer is something weird! 4200656 is a digit?!!! tnx for your help

ehsanehsh
Автор

A very important question, even when i delete the <ctype.h> I still can mix int and char in definition, so what's up?
and why when I define something as char for example but %c in scanf it gives wrong result? I thought c.type will allow me to do it vice versa?

mohammedfawaz
Автор

Mine is :



int main()

{
char grade;
printf("enter your grade : ");
scanf(" %c", &grade);

switch(grade){
case 'A' : printf("ok");
break;
case 'B' : printf("nope");
break;
case 'C' : printf("lmao");
break;
case 'D' : printf("lmfao");
break;
case 'F' :
break;
default : printf("you're wrong");
}
return 0;
}

rayane
Автор

Characters are the most primitive integer type

rban
Автор

Can't i assign a two digit integer or three digit to the value of tuna as we gave '9'.

rohitkumar-rbds
Автор

when I test digit (i.e 2, 3, 9, 5) i get a strange sign like "@" instead of that number on printf output. but incase of letter or other symbols it does not happen.

nibir
Автор

Do you have a video covering Classes and Methods in C?

psygrimlock
Автор

guy hep me figure out whts wrong!. even if i define the variables as int type, still only "single quotes" if block gets executed. isupper method is from the next video(33)

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>


int main()
{
int A = 'A';
int AA = "A";

if (isupper(A)){
printf("single quoted");
}
if (isupper(AA)){
printf("double quoted");
}
return 0;
}

damithjay
Автор

so can you please make a program to tell us how computer works?

cityvoyage
Автор

"isdigit" doesnt works with 2 or more digit number..!!! thnx for ur help..

abhaykd
Автор

What is the difference between int tuna = 9 and int tuna ="9"?

ventin