Pavel
Pavel
I mean there's pointer to memory, it can point to an element or to an array.
The same way you can have a pointer to pointer (like int**), then it can be 2d array, or array of pointers to elements, or pointer to pointer to an element, or pointer to an array. It's hard to guess what you mean without code
Ausir
@gameraccoon that's my code: https://pastebin.com/hLqWPLfz
Ausir
Could you explain me better? I did not understand
Pavel
I always discouraged by this C syntax
Anonymous
hey guyz
Ausir
Pavel
Then I would suggest to go with the second approach, and just calculate the index by yourself. Maybe someone else can suggest a better solution, I can't think of one right now.
Wendy
Am writing a program that allows user to input 4 number and I want the program to re arrange the number input by the user
Wendy
I need help
Anonymous
Anonymous
Good evening
Solo
How can I contact admin ?
Anonymous
Solo
Thinking about to promote discord server for developers
Anonymous
No thanks
Solo
We are paying for that ...
Hanz
Wallet intensifies
Ilya
/get cbook
Kishore
Anyone help me with c programming? I am actually beginner. I want to learn c from scratch
Sasuke
𝗠𝗿.𝗕𝗘𝗔𝗦𝗧
/get
𝗠𝗿.𝗕𝗘𝗔𝗦𝗧
Hi
Anonymous
/report
Anonymous
IMAGINE YOU ARE A DATABASE ADMINISTRATOR (DBA) FOR PENTAGON, US MINISTRY OF DEFENSE. YOU ARE HAVE A SPECIAL TASK OF DESIGNING DATABASE SYSTEM WHICH WILL BE USED WHICH HAS BEEN CONTRACTED TO PROVIDE SECURITY FOR GOVERNMENT LEADERS. OUTLINE IN DETAILS
- THREE MAJOR FUNCTIONS OF THE DATABASE,
- THE TABLES(FIVE) INVOLVED AND ITS USERS (AT LEAST THREE).
any one can help me point of this assigment
Anonymous
Anonymous
Anonymous
It's so funny
Dada
What is the advantage of using pointer objects like
MyClass* pMyClass;
MyClass->MyFunction();
over this actual objects
MyClass myClass;
myClass.MyFunction();
Anonymous
Anonymous
but be careful pointer errors can be fatal and its also to for people without knowledge really dangerous
Anonymous
If you need to not copy the object, you pass a reference. Raw pointers in C++ are discouraged
Anonymous
I used pointers only in C.
Dada
Dada
tat helps
Anonymous
lol, 2nd account?
Anonymous
Lol
Anonymous
At least use coherent phrases
Anonymous
``
char ch;
while((ch = getch()) != '\n');
``
And
``
int ch;
while((ch = getch()) != '\n');
``
Here both works, iam confused here why. Which should i use or both are same?
Ilya
Because char can be converted to int. Every character has its digital code.
Anonymous
Oh so that means its same yah?
Ilya
Not at all. If you use 'char ch', you will receive characters: 'a', 'b', 'c' etc. If you use 'int ch', you will receive characters codes corresponding to the ASCII table
Anonymous
And what about this
char arr[3];
Now let's say i read some character from file and store in arr using sscanf.
Now what about this
int ch = arr[0]
Anonymous
At what condition should i use int or char
Ilya
there will be the ASCII code in 'int ch' of the very first character arr[0]
Ilya
If you want to work with strings and characters - use char
Ilya
If you want to create magic with ASCII codes offsets, use int
Ilya
but you also can write smth like that:
char c = 'a';
c++;
Ilya
but note, that, if you create string (char *arr[3]), the incrementing operation will mean another operation
Ilya
there will be pointer arithmetics
Anonymous
Ilya
I don't know how to explaing it correctly. But you can read about bit operators '< <' and '> >'
Ilya
Offset is about shifting smth.
Anonymous
Mohit Kumar
Sorry
Anonymous
Thanks for you help dude
Anonymous
Can i see c library functions defination?
Anonymous
Any site out there
Anonymous
I searched but didn't found
Ilya
you have it on your system
Ilya
look for "include" path or smth like that
Ilya
you also can open IDE (CodeBlocks for example), than right click on the function and then smth like "Got to definition"
Anonymous
Basically i am using android so its little hard to see properly
Ilya
https://en.cppreference.com/w/c
Anonymous
No just for research only
Igor🇺🇦
No just for research only
You can check gcc source code if you're that interested https://github.com/gcc-mirror/gcc
Anonymous
Ok
Ilya
And also clang)
Anonymous
Ok sure
Thierry
whats the best way to set the value of an array field of a structure pointer in C?
is it really like the following?
T arr = { ... }; // size n
memcpy(mystruct->arrfield, arr, n);
Ilya
You need to wrap memcpy() in function to check some things:
1) you've allocated memory for struct->arr
2) you've put the correct size (n) to memcpy