Engineer
Heard it is possible for Sanskrit?
Anonymous
There's such thing called Computational Linguistics
Engineer
As it has a well defined syntax and specific rules.
Anonymous
Lmao
Engineer
There's such thing called Computational Linguistics
Wow learning something new every day! Thanks!!!
Engineer
No not WhatsApp https://medium.com/@tomgoldenberg/sanskrit-the-first-programming-language-d8647753217f
Merazi
No not WhatsApp https://medium.com/@tomgoldenberg/sanskrit-the-first-programming-language-d8647753217f
We all know A was the first programming language, and c is the third one, the perfect ending for the trilogy
klimi
Just code in C (or asm)
Engineer
How can we write out a CFG using LLVM from a C++/C program?
Engineer
Are you sure? The LLVM documentation says otherwise https://llvm.org/docs/ProgrammersManual.html#viewing-graphs-while-debugging-code https://llvm.org/docs/tutorial/OCamlLangImpl5.html To visualize the control flow graph, you can use a nifty feature of the LLVM ‘opt’ tool. If you put this LLVM IR into “t.ll” and run “llvm-as < t.ll | opt -analyze -view-cfg”, a window will pop up and you’ll see this graph:
Engineer
I was talking about Control Flow Graph🙈
Rajath V
Anyone accepting PR for hackoctober? If yes please send me repo link
Spectre
Ok
Arsen
On the standard input stream, a number n (n ≤ 100) is given, then n natural numbers a1, a2, ... an. It is required to find numbers b1, b2, ... bn, where bi is the number of primes less than ai. The displayed numbers must be separated by a space. To solve the problem, use a dynamic array. Examples of Input data 5 1 2 3 4 5 Result of work 0 0 1 2 2 #include <iostream> bool isPrime(int n){ if(n == 1) return false; for(int i = 2; i*i <= n; ++i) { if (n % i == 0) return false; } return true; } int main(){ int size; std::cin >> size; int* dynArr = new int[size]; for(int i = 0; i < size; ++i){ std::cin >> dynArr[i]; int count = 0; for(int j = 0; j < dynArr[i]; j++){ if(isPrime(dynArr[i])){ count ++; } //int* dynArr2 = new int[i]; //int* resArr = new int[i]; //resArr[i] += count; //std::cout << dynArr[i] << " "; std::cout << count; } //std::cout << dynArr[i] << " "; } return 0; delete[] dynArr; } who can say what is my mistake
Arsen
ok
Alen™
#include <stdio.h> main() { x=5 def add(); x=3; x=x+5; print(x); add(); print(x); return 0; } ... Anyone who can ask me my mistake... Error--- source_file.c: In function ‘main’: source_file.c:5:1: error: ‘x’ undeclared (first use in this function) x=5 ^ source_file.c:5:1: note: each undeclared identifier is reported only once for each function it appears in source_file.c:6:1: error: expected ‘;’ before ‘def’ def add(); ^~
Andrew
Merging python with C?
Andrew
Vlad
*this is where suffering begins
Alen™
Merging python with C?
🤔🤔but how i have written only c language code
Alen™
Yaa u r right
Alen™
How to solve error...
Vlad
Vlad
bruh
Vlad
How to solve error...
/report pm'ing
Andrew
You dont have to write so much code to see what number is higher
Anunay
How to solve error...
/warn don't pm without prior permission
Talula
Sorry I didn't know the rules
#include <stdio.h> int main() { int a, b, c, d, y; printf("Enter four integers (separate them with spaces): "); scanf("%d %d %d %d", &a, &b, &c, &d); if (a > b && a > c && a > d) { if (b < c && b < d) y = b; else if (c < b && c < d) y = c; else if (d < b && d < c) y = d; printf("Largest: %d\n", a); printf("Smallest: %d", y); } else if (b > a && b > c && b > d) { if (a < c && a < d) y = a; else if (c < a && c < d) y = c; else if (d < a && d < c) y = d; printf("Largest: %d\n", b); printf("Smallest: %d", y); } else if (c > a && c > b && c > d) { if (a < b && a < d) y = a; else if (b < a && b < d) y = b; else if (d < a && d < b) y = d; printf("Largest: %d\n", c); printf("Smallest: %d", y); } else if (d > a && d > b && d > c) { if (a < b && a < c) y = a; else if (b < a && b < c) y = b; else if (c < a && c < b) y = c; printf("Largest: %d\n", d); printf("Smallest: %d", y); } return 0; }
Hadaward 'Solly'
i think that you want to use !report or something
Talula
to much code for comparing 4 integers, just put them in an array and loop them. to get max and min
I just rearranged his code so he doesn't get compilation error...
Talula
But i write same code and i got errors
Edited the code, try again... it should've been int main()
Andrew
it compiles with main also
Talula
it compiles with main also
It should but as you have return 0; logically it shouldn't.
Andrew
maybe depends on compiler , but for default if you dont put any return typo is int
Vlad
Normally it's void... not int
int is the default return type in C
Vlad
main(void) {} compiles and deduces to int main(void);
Talula
int is the default return type in C
Which C? I use CCS - C (for embedded) and it's void.
Hadaward 'Solly'
think about processes and how they communicate. That's why int is standard in main return specifications. It's a way to talk to the OS itself
Vlad
Btw void main is not standard conformant
Hadaward 'Solly'
Why some IDEs allow void tho? Well, first of all: they set their environments with specific/proprietary compilers that allow such behavior second: newbies dont need to specify 255 different return codes for debugging
Hadaward 'Solly'
in that sense, code::blocks is a... "very abstract C" learner's friend
Anonymous
Hi. I cannot install SDL2 in visual studio, any help?
Hadaward 'Solly'
Hi. I cannot install SDL2 in visual studio, any help?
provide info on errors so someone can help you
Anonymous
provide info on errors so someone can help you
https://thenumbat.github.io/cpp-course/sdl2/01/vsSetup.html#:~:text=into%20your%20project.-,Project%20Settings,in%20your%20SDL%20source%20folder. I followed these instructions and...
Anonymous
Hadaward 'Solly'
did you remember to move the SDL extracted files to your project folder?
Andrew
im not sure by try with #include "SDL.h"
Hadaward 'Solly'
the setup he does is exactly to avoid these preprocessing shenanigans but if it works, it works
Anonymous
Doesn't work
Roxifλsz 🇱🇹
Roxifλsz 🇱🇹
Kinda sus
Anonymous
guys I find these days my bottleneck is memory access speeds
Anonymous
for example in my feed forward fully connected MLP's
Anonymous
30% of the time is spent doing math and 70% is iterating megabytes of memory
Anonymous
when I am working on neural networks I like to keep all of the prototyping on a regular desktop, atm I use a ryzen CPU with a few cores
Anonymous
standard ram speeds, 3200 mhz or something
Alex
try to decrease memory usage or keep it align
Anonymous
right I do my best to keep it cache aligned
Anonymous
other than that, just like, faster memory and a mothrboard that supports it ?
Anonymous
overclock memory maybe ?
Anonymous
https://www.overclockers.co.uk/g.skill-trident-z-royal-16gb-2x8gb-ddr4-pc4-36800c18-4600mhz-dual-channel-kit-gold-f4-4600c18d-my-11a-gs.html
Dima
#ot