Nameful
yes
to most search engines, putting a - before your search term means "exclude this term"
Anonymous
Nomid Íkorni-Sciurus
Hariyana Grande
somebody told me to compile with -wall
Hariyana Grande
Anonymous
Hariyana Grande
yes wait
Chr
Hi I am looking for job on C domain
Chr
Can any one suggest Me how to prepare resume and what should I do
Thierry
!report DARONG
pm without asking
klimi
Thierry
Sorry already reported and blocked/deleted chat on tg
klimi
Roxifλsz 🇱🇹
Ah
Roxifλsz 🇱🇹
Well next time I'll just ask to drop the screenshot into my PMs
Thierry
Well just wanted to inform and potentially prevent further pms
klimi
we should make meta group
Tasneem🩷
Help me
ARNAV
Tasneem🩷
(Perfect number ) a positive integer is called a perfect number if it is equal to the sum of all of its positive divisors , excluding itself .for example ,6 is the first perfect number because 6=3+2+1. The next is 28=14+7+4+2+1. There are four perfect numbers less than 10000.write a program to find these four nembers?
Tasneem🩷
(Simulation head or tail) write a program that simulates flipping a coin one million times and displays the number of heads and tails?
Anonymous
Tasneem🩷
Anonymous
Tasneem🩷
??
klimi
Anonymous
Pavel
??
It's not a group where people will do tasks for you, it's a group for people who want to learn
מנחם
Why this code fly after 8 numbers?
(the program is creates a dynamic array, and reads 15 numbers)
int *new_arr = new(nothrow) int(15);
if(new_arr == nullptr)
exit(1);
cout << "Enter " << 15 << " values: ";
for (int i = 0; i < 15; i++)
cin >> *(new_arr++);
Anonymous
Anonymous
It's not an array
מנחם
Ilya
Array is constracting via sqare braces
Suka
perhaps?
public:
character(const char *ptr)
{
this->ptr = const_cast<char*>(ptr);
}
void *operator new(size_t size); // you miss the ;
Rizaldi
hello sir, i want to ask. how to compare array?
מנחם
Hariyana Grande
static char s[] = {"black", "white"}; //why this not valide
static char *s[] = {"black", "white"}; //but this is valid
Ilya
Because the first is just string
Ilya
The second is array of strings
Hariyana Grande
so cant we say first one as array of char
Ilya
No, we cant
Rizaldi
maybe
strcmp(arr1,arr2)
can I combine this with if else? so if thats array its same i will give some command
Hariyana Grande
ok and there is no string data type right in c ?
Ilya
String is an array of chars
Ilya
char* or char[]
Ilya
Also you have such functions like strcmp()
Ilya
See cppreference.com - C section
Ilya
string.h header
Hariyana Grande
i am confuse let me paste the program jst sec
מנחם
Hariyana Grande
oops wrong
Hariyana Grande
#include<stdio.h>
int main()
{
static char *s[] = {"black", "white", "pink", "violet"};
char **ptr[] = {s+3, s+2, s+1, s}, ***p;
p = ptr;
++p;
printf("%s", **p+1);
return 0;
}
Hariyana Grande
so my question was how can you assing a pointer to char without its being declared
Hariyana Grande
the first line of code
Roshan
Is there any js ajax group?
Hariyana Grande
i mean where is array of characters all i see is strings in first line
Ilya
See:
char - simply one character
char* or char[] - string (array of chars)
Ilya
char *[] or char** - array of strings
Ilya
If you want to get one char from string, do:
char ch = str[index_of_character]
Ilya
Yes. And a pointer to the first character simultaneously
Ilya
Read about arrays in C and about pointer arithmetic
Hariyana Grande
so i can declare like this - char* s[]={"how", "are","you"}; ?
Ilya
Yes
Hariyana Grande
ok thank you so much for clarifying this
Roshan
Ilya
You'd better to watch video or read smth about arrays in C, pointer arithmetic and two possible ways to create arrays: WITH specifiyng size and WITHOUT it
Hariyana Grande
i got confused cause i studied pointer this was- first step- int a; step 2- int *p step 3 p=&a; so i was woried where the first step gone in above program lol
Hariyana Grande
*this way
Ilya
These steps are used when you want to take an address (pointer) of the already existing object
Ilya
If you are creating smth like arrays, you arent needed first step
Hariyana Grande
oh i see it makes sense now i didnt know that
Hariyana Grande
pointers are pain
Ilya
but you still can do this way
int arr[20];
int *parr = arr;
Welcome to the C bro😂