Тёмный

Ternary Operator | C++ Tutorial 

Portfolio Courses
Подписаться 226 тыс.
Просмотров 2 тыс.
50% 1

How to use the ternary operator in C++. Source code: github.com/por.... Check out www.portfolioc... to build a portfolio that will impress employers!

Опубликовано:

 

2 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 9   
@abhinavpeddapalli5906
@abhinavpeddapalli5906 2 года назад
Sir pls let me know why this program is not working
@abhinavpeddapalli5906
@abhinavpeddapalli5906 2 года назад
/*binary search program using dynamic allocation of strings */ #include #include #include void main() { int i,mid,low,high,n,s; char **a,**key; printf("enter the number of strings of n "); scanf("%d",&n); a=(char **)malloc(n*sizeof(char *)); key=(char **)malloc(1*sizeof(char *)); for(i=0;i
@PortfolioCourses
@PortfolioCourses 2 года назад
It looks like you want to use key to store a string, but you have declared key as char ** and used malloc twice with it, once as if it is char ** and then as if it is char *. That seems really unusual to me, I think you want key to be a char * so you can dynamically allocate space to store a string to be the key. These videos might help you out and give you ideas to solve the problem you are trying to solve: Binary Search Algorithm: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Uuyv88Tn9iU.html Dynamically Allocate Memory for Array Of Strings: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-4_2BEgOFd0E.html Sorting An Array Of Strings: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-LZNxRSoEG2M.html
@heroxgm4030
@heroxgm4030 9 месяцев назад
my I ask which editor is it?
@abhinavpeddapalli5906
@abhinavpeddapalli5906 2 года назад
Its urgent
@MeIsUser
@MeIsUser 2 года назад
Is that the only ternary operator in c++??
@PortfolioCourses
@PortfolioCourses 2 года назад
Yes. :-)
@abhinavpeddapalli5906
@abhinavpeddapalli5906 2 года назад
Superb
@PortfolioCourses
@PortfolioCourses 2 года назад
Than you Abhinav! :-)
Далее
For Loops | C++ Tutorial
12:09
Просмотров 898
Ternary Operators in C++ (Conditional Assignment)
8:01
Лиса🦊 УЖЕ НА ВСЕХ ПЛОЩАДКАХ!
00:24
Iran launches wave of missiles at Israel
00:43
Просмотров 820 тыс.
Function Templates | C++ Tutorial
10:54
Просмотров 7 тыс.
Introduction To Classes And Objects | C++ Tutorial
11:49
Naming Things in Code
7:25
Просмотров 2,1 млн
Operators - C++ Tutorial For Beginners #5
20:52
Просмотров 15 тыс.
why do header files even exist?
10:53
Просмотров 410 тыс.
CONSTANTS in C++
8:31
Просмотров 27 тыс.
Range Based For Loop | C++ Tutorial
9:15
Просмотров 6 тыс.
Лиса🦊 УЖЕ НА ВСЕХ ПЛОЩАДКАХ!
00:24