Serenity
I'll explain it more specifically
Serenity
I have a supermarket struct
Serenity
and It has product ** product_list field
Serenity
I want to increment **product list field
Anonymous
#include<stdio.h>
int main() {
int a[2] = {0,1};
int *b = a;
int **c = &b;
(*c)++;
printf("%d", **c);
}
Anonymous
Here's an example
Anonymous
Good luck
Anonymous
#noendl
Renan
NXiss7
Dafaq
Renan
Anonymous
Prosvetlennii Dimas
Help me with cmake pls. I found SFML via find_package and want to add .dll files from package to the install location. How to do this
Vishnu
I guess a counterexample will be enough to disprove the statement🤔
Anonymous
Anonymous
Anonymous
Should I give her the third warn about screen photo?🤔
Anonymous
So if someone post screen photo of ads should banned immediately
Anonymous
/get cbook
Pasindu
/get
Anonymous
/get
Anonymous
/get ide
Anonymous
It replaces the current memory allocator with itself
Dima
/warn read the rules
🐢
Can you recommend me a book for c application/examples
...
Char *str="Nice test" ;
Francisco
The problem is that in C++ you can't convert a const char* into a char*, but I think you can in C
Anonymous
Anonymous
Anonymous
const char* example is:
char *a = "string";
Anonymous
You are assigning a const char * string literal to a char
Anonymous
const char* example is:
char *a = "string";
Now if we do this:
a[1]=NULL;
The program will segfault
This is because modifying a string literal is undefined
toytta
Good morning fellas
Someone here knows how to read, recognize and print the dimensions of an .png archive in C?
If yes, could you help me?
Karan
Calling all coders. At 6 PM today play CodeCarnival organised by IIIT Naya Raipur and Dare2Compete Online Hackathon Festival (OHF) Season 2 and stand a chance to win prizes worth INR 50K, eCertificates to Top 100 for excellence and to all for Participation.
To register and to play head to https://d2c.pw/wH22n
#OHF #OnlineHackathonFestival #D2COHF #Dare2Compete #StayHome #StaySafe #KeepCoding
Dima
Dima
Francisco
Yes I can, or at least gcc 10.1 lets me do it
Francisco
Other thing is modifying something, but at least gcc and clang definetly lets me do it
Cool Guy
Hello People Can anybody tell me how to convert this algo in c program.
Cool Guy
Please can anybody guide me in this?
Artöm
Write a function array_sum(int* rr, size_t n) (or float if it's an array of float values)
Artöm
Algo is given man. Sum all elements in a variable in for loop, then return the variable
Anonymous
The time complexity of this algorithm is a constant n where n=size
Gregory
O(N). Lenear
Anonymous
Anonymous
...- string literals have a type...
Anonymous
...i always thought they were some internal compiler representation that could be assigned to const char *
Artöm
Anonymous
Think about it
Anonymous
Array is a contiguous allocation
Anonymous
You know that pointer + offset will be the next element to the array
Anonymous
Whatever that offset be, depends on the architecture
Anonymous
But when you declare char *a ="something";
Anonymous
*(a+1) points to something entirely different
klimi
klimi
uwu
klimi
i will go do some coding
Artöm
Anonymous
Artöm
I can prove it. Can you contra?
Anonymous
Hi guys! cant reallocate memory. what's wrong?
typedef struct date
{
int day;
int mon;
int year;
}DATE;
DATE *arr;
int size = 1;
arr = malloc(sizeof(DATE));
for (; scanf("%d.%d.%d", &arr[size].day, &arr[size].mon, &arr[size].year) == 3; size++)
{
arr = (DATE*)realloc(arr, ((1 + size) * sizeof(DATE)));
}
Artöm
Artöm
Anonymous
ops) size = 0?
Artöm
Anonymous
thanks)
Anonymous
Francisco
Really? Hard to believe, though
Dima
lol!
Dima
never believe anyone
Dima
in fact, in my country the real professors are at the same level lol
Francisco
Well, claiming something doesn't make it true. I've seen horrible teachers, but none of them was so wrong about their subjects (or at least not THAT wrong)