Artöm
Function declaration looks like ret name(args); You dont have ret piece in your code
Artöm
If these lines are calling functions, as I said its forbidden to call functions without declaring anything in global scope
Artöm
Inside main or inside other functions
PO
I have 4k.h in which I give all the prototype
PO
now I get these error
PO
I declared all of them inside my 4k.h
Artöm
Show main code
PO
Artöm
Whats pF? It is not declared anywhere
Artöm
Other errors are same
klimi
No it does not
Its shown in the guide (when I lastly installed gentoo)
Anonymous
Its shown in the guide (when I lastly installed gentoo)
That does NOT mean it is done by default
klimi
That does NOT mean it is done by default
Sure if you want it that way
klimi
That does NOT mean it is done by default
By default the system isn't even working btw
PO
Whats pF? It is not declared anywhere
is a pointer type Gtkwidget
PO
Whats pF? It is not declared anywhere
I declared in function in its file but in main this pointer called window_pointer I fixed
Anonymous
int a[4] = {1,2,3,4}; int b[4] = {1,2,3,4}; int n = &b[3] - &a[2]; Value of n is 5. Any logic behind this, or does it vary between compilers?
Anonymous
It'll often generate worse performing code
i would very much like some auto-vectorisation black magic when dealing with a hundred thousand floats
Anonymous
Even on android we specifically target code written for the CPU to begin with and only compile that with -march=native
also on Android does -march=native even make sense? isn't ARM instruction set basically fixed?
Anonymous
also on Android does -march=native even make sense? isn't ARM instruction set basically fixed?
(compared to x86 where there are new ways of doing SIMD every two intel generations)
Artöm
And yes it may vary
Dev
I'm just going to start c can anyone tell me how to do it
Abd_jack
Any code
Abinaya
Done🙂
Anonymous
Hello, does anyone know a site where I magician types of different tasks with c ++ and their solution
Tokin
What do you mean?
Tokin
Oh quests based learning or some stuff?
Nothing
Hey everyone, can anyone tell me why is the output of this code is not the same every time? i know that the fork will create a child process but i couldn't understand the output!
Alex
check your OS if order of child/parent process execution is specified after fork
Nothing
check your OS if order of child/parent process execution is specified after fork
how is that? i don't think it is about my OS because i had the same issue when i compiled the code in online debugging websites
Alex
show your different output
Alex
I know the possible reason: you have several processes, so OS can decide which process to run "randomly"
Alex
but you have small program, so it should be the case every time, if OS is not heavy loaded
Alex
you have not checked : int i = 1; printf("i = %d\n", i); fork();
Alex
so after this fork both child and parent process creates new child
Alex
thus, order of execution is not specified
Nothing
ah okay thanks for the help👍🏻
Anonymous
I have such a task, but I do not know which algorithm I need to use here,who can help
Anonymous
Write a program that gets a natural number N (N ≤ 1000) at the input, then a sequence of N characters. As a result, the program must display the digits of the sequence and then the remaining characters. The displayed characters must be separated by a space. Use array to solve the problem.
Anonymous
#include <iostream> int main() { int N; std::cin >> N; int arr[1000]; for( int i = 0; i < N; i++){ std::cin >> arr[i]; }
Anunay
Use your brain
Anonymous
I'm trying and just starting to learn
Anonymous
Iam trying to understand myself from a weak but I need some help,please
LK
Iam trying to understand myself from a weak but I need some help,please
n % 10 gets only last element.. Example: 102 % 10 gives 2 And its storing that value into digit variable.. and then it checks whether it's repeated or not using bool n/10 removes last element...
Anonymous
I can't understand " if(digitseen[digit]) " what is it mean
LK
Array subscripts always start at zero... so the elements are digitseen[0], digitseen[1].. digitseen[9].
LK
Lets take example: 12341 digitseen [10] is false.. means from 0 to 9 is false. 12341%10 = 1(digit) Now if condition is false, cz you have declared digitseen[10] is false.. Now digitseen[1] is true... this means digitseen[0] is false digitseen[1] is true and others are false... 12341/10 = 1234 Again loop starts with 1234 1234%10 = 4(digit) Again if condition is false cz, digitseen[4] is false So digitseen[4] becomes true 1234/10 = 123 Repeats till 1 comes... While checking condition for element 1... If digitseen[1] is already true so it breaks..
LK
Now you understand?
Anonymous
anyone can you check it?
Anonymous
#include <iostream> int main() { int N; std::cin >> N; int arr[1000]; for( int i = 0; i < N; i++){ std::cin >> arr[i]; } for (int i = 0; i < 1000-1; ++i) { std::cout << N << " "; } }
Anonymous
i guess that's wrong
Anonymous
Write a program that gets a natural number N (N ≤ 1000) at the input, then a sequence of N characters. As a result, the program must display the digits of the sequence and then the remaining characters. The displayed characters must be separated by a space. Use array to solve the problem.
Indolent
transform(sample.begin(), sample.end(), sample.begin(), [](char c) -> char{return c == 'y' ? 'x' : 'y';});
Indolent
What is happening in the last parameter?
Indolent
"[](char c) -> char{}
Indolent
What is the meaning of this expression?
Anonymous
What is the meaning of this expression?
https://docs.microsoft.com/en-us/cpp/cpp/lambda-expressions-in-cpp?view=vs-2019
Indolent
accumulate(something.begin(), something.end(), string("")) What is the string("") parameter doing?
piggyho
"[](char c) -> char{}
lambda function captures nothing takes one character parameter is expected to return a character but does not have a return statement in it, thus error there's nothing in the back does nothing
Artöm
On line 52 there should be sizeof(char*)
Artöm
Line 85 leaks memory btw
Artöm
Look at 85
Artöm
It frees end of pointer array, but does not free memory pointed to by them
Artöm
You leak some of what you calloced at 55
Artöm
Yes
Artöm
Use debugger, track pointer values
Serenity
Why does returning a pointer to a local variable yield undefined behavior ?
Serenity
from a function
Anonymous
Using the pointer is UB