Anonymous
👋 how can i read a json file in codeblocks? can anybody help me ?
Doreece
Hi.I want to limit the number of times my scanf("%c",&a) works to n in a loop . can anyone help me ?
DaviChan
shouldn't %c work just one time? for one character?
Yeah, but you can add +i*sizeof(char) as an offset to your buffer pointer, where i is the counter in the loop
DaviChan
I think that was requested? Not actually sure
Doreece
shouldn't %c work just one time? for one character?
Yes but the question is this : The user gives a number such as 5 And then you should scanf some characters 5 times
DaviChan
Okay, sizeof is not a function though
DaviChan
I guess you want something like that: size_t buffer_size=0; scanf("%zu", %buffer_size); char* buffer = malloc(buffrr_size); for(size_t i=0; i< buffer_size; ++i) scanf("%c", (buffer+i)); free(buffer);
DaviChan
You might need some casts here and there. See it sudo code rather 😅
DaviChan
should be fine with an ansi c compiler. I guess a cpp compiler would vomit
DaviChan
Welcome ✌
Anonymous
Anonymous
Guys i have a problem which is failing to run which is a simple computer game its giving me a lot of errors but i cannot post it here as it is showing a lot of non english related language
Xi
Can one develop a simple game in Xcode?
Xi
No. That's illegal
What can it be used for then coz I use VS more
zelika
launch:program <file path>/debug/outDebug doesn't exit
zelika
launch:program <file path>/debug/outDebug doesn't exit
how can i fix that? i alreay tried to reload c/c++ runner and vs code but it didn't work.
Yotic
I downloaded a project from a person (Without a github file bounds, etc.), I also downloaded v142 tools (project is old and needed this tools version), because I thought that this error due to wrong tools version. The error is - LNK1104: cannot open file 'D:\VS\repos\Echos Client\packages\minhook.1.3.3\build\native\..\..\lib\native\lib\libMinHook.lib As I understand it, the wrong path is set somewhere, where can I change it? UPD: I downloaded dll and put in D:\VS\repos\Echos Client\packages\minhook.1.3.3\lib\native\lib\ and now it works
ved prakash
1. Download and Install Visual Studio Code - Go to code.visualstudio.com and download Visual Studio Code - Install and at the 'additional tasks' section make sure "Open With Code" and "Add to Path" are selected 2. Download and Install a compiler You can either use MSVC that comes with Visual Studio (not VSCode) or use GCC as part of a mingw distrubion, I recommend using nuwen's distro as it is small and fairly recent. - Go to the MinGW Distro page and download the self-extracting archive [1] - Select a target directory to install it to, (e.g. C:\) - Add the bin directory to your environment path (the bin directory is your target directory + MinGW\bin, so in this case it would be C:\MinGW\bin) - You should be able to open a command prompt and verify your compiler is found, e.g. by entering gcc --version 3. Setup Visual Studio Code - Open VSCode and head over to the extension menu (CTRL + SHIFT + X) on the left hand side, search for the C/C++ extension by Microsoft and install it and restart Visual Studio Code afterwards. 4. Getting started - Create a folder for your project, right-click and "Open with Code". Whenever you opened a workspace the status bar at the bottom will be blue. Otherwise it will be purple. - Create a file and write your code. - On the left hand side, select the "Run" option (CTRL + SHIFT + D) and click "Run and Debug", select "C++ (GDB/LLDB)" and g++ as the compiler. - This will create the default launch configuration. Pressing "F5" will build and start your currently focused file. - At this point IntelliSense should be working and you should be able to set breakpoints and step through your code. [1] https://nuwen.net/files/mingw/mingw-18.0.exe
Thanks
Devendra
Any Developer here from Gujarat ? We are looking for tech co founder for our start up.. We are edtech 2,10,000+ Downloads On Play Store Need very experienced and passionate developer who want to build a global product..
Dropthetap
Hello guys. Can anyone tell me, which framework should i choose for web development as a beginner.
Jose
Hello guys. Can anyone tell me, which framework should i choose for web development as a beginner.
Not using C++ for web development, for example Moreover, there is no "frameworks" in C++, like web development languages as Javascript has. Think about Qt. The nearest to a definition of "framework", and the equivalent is like Node itself - you could think it will be like D3 visualization framework but no, it's a complete suite to create programs, not a more-like-a-library, not a component, an entire system
Islom M1Ö
Hi everybody
Islom M1Ö
#include<stdio.h> #include<stdlib.h> #define SIZE 100 int** fun() { int i,j,m,n; scanf("%d*%d",&m,&n); int a; **a=(int )malloc(m*sizeof(int)); for(i=0;i<n;i++) a[i]=(int *)malloc(n*sizeof(int)); for (i = 0; i < m; i++) { for (j = 0; j < n; j++) { scanf("%d", &a[i][j]); } } return a; } int diagonal(int a) { int sum = 0; int i, j; int m, n; for(i=0;i<m;i++) { for(j=0;j<n;j++) { if(i==j) { sum = sum + a; } } } return sum; } int main() { int a, sum; a = fun(); sum = diagonal(a); print("%d", sum); return 0; }
Ilya
int a; **a=(int )malloc(m*sizeof(int)); this part is wrong
Ilya
it should be something like this int **a = (int**)malloc(m*sizeof(int*)); for(i=0;i<m;i++) a[i]=(int*)malloc(n*sizeof(int));
Konstantin
Who knows what is wrong with my code
Check the types at all the steps. Check that your logic implemented correctly line by line.
Ilya
Who knows what is wrong with my code
Also you didn't free the memory that was allocated
Anonymous
hey! who has time to work with me on a programm?
Islom M1Ö
#include<stdio.h> #include<stdlib.h> #define SIZE 100 int** fun() { int i,j,m,n; scanf("%d*%d",&m,&n); int a = (int)malloc(m*sizeof(int*)); for(i=0;i<m;i++) a[i]=(int*)malloc(n*sizeof(int)); for (i = 0; i < m; i++) { for (j = 0; j < n; j++) { scanf("%d", &a[i][j]); } } return a; } int diagonal(int a) { int sum = 0; int i; for (i = 0; i < sizeof(a); ++i) { sum = sum + a; } return sum; } int freeFunc(int m) { free(m); return m; } int main() { int a, sum, b; a = fun(); sum = diagonal(a); b = freeFunc(sum); print("%d", b); return 0; }
DaviChan
Hello guys. Can anyone tell me, which framework should i choose for web development as a beginner.
I liked using drogon. Also think it it easy to use. But never built anything big with it. I wanted to build a CMS with it for a long time
DaviChan
Especially to an int which makes no sense and might be narrowing
Leonardo
guys can i use bool variables in C?
Leonardo
without an implementation with a library
DaviChan
guys can i use bool variables in C?
Depends. What C Standard do you use?
DaviChan
Im not sure there
DaviChan
try: #include <stdbool.h>
DaviChan
I think that was the right one
DaviChan
Popular Question: What UI framework to use for ceoss platform projects^^? Currently my choice is between: - WxWidgets (robust, native, con: no mobile support yet) - nuklear (intermediate mode, minimal, con: needs a GPU most likely) - Qt (industry standard, con: non-standard, non ideal license)
DaviChan
Also a common con: written in C, so I would need to write a wrapper to have a modern C++ interface
DaviChan
Any thoughts or suggestions?
DaviChan
I want something that is "an okay fit for almost everything"
DaviChan
Like C++ is lol :p
dracula
Please I need someone to assist me on analyzing a question. It’s on a picture and this channel don’t permit sharing of files. Please inbox me if you have time to assist me. Thanks
DaviChan
I think sharing links is fine, so maybe upload to imgur?
Anonymous
hi everyone. how can i fix visual studio sfml linker error?
DaviChan
Would need more context 🤔
Anonymous
i think
Anonymous
i just created a simple window but got a linker error
Anonymous
i don't know
Sen Sovisal
What's flush(stdin) mean?
DaviChan
What's flush(stdin) mean?
clears the input buffer. Usually called before reading something from stdin
DaviChan
wasn't it fflush though? flush might behave a little different. Not sure how it is defined
Aurora
memfd_create and mmap should work?and ipc
Aurora
Anyone?
Konstantin
What is good for beginners? Hammer or screwdriver? Language -is a tool for some scope of tasks.
robin
they are the same at the beginning
Konstantin
There is a BASIC language. For school and so one. But it is offtopic here.
robin
I recommend C as the first language
robin
if someone feel C is hard to lean, I recommend him to learn python firsr
robin
my pleasure
robin
does anyone have group related with golang? I maily use golang to develop
robin
telegram group or discord org
S
Does anyone knows a good/promising open source project based on C++ ? I’ve some free time and want to improve by working on a community project to learn and gain more experience
robin
a opensource RPC framework