Tobias🐾🚲
## Rules #pinned * You are not entitled to an answer, getting angry about not answered questions will get you warned. * Not checking your problem in google (or any other search engine) first will get you a warn. * Asking to solve an assignment/test/whatever without trying it first yourself will get you a warn or will get you BANNED. We won’t write a code for you, but we can push you forward and suggest something. * Before posting a long code snippet think twice and read the Resources section below. * No “best book” or “best youtube channel” requests, use /get cbook and /get cppbookguide chat commands. * No “best ide” requests, use /get ide chat command to see the suggestions. * Asking for something that is in the pinned message right after joining WILL GET YOU BANNED. * C/C++ discussion preffered (assembly also allowed), asking about other languages (or groups for other languages) right after joining will get you BANNED. * Reverse enginnering, hacking and related topics are allowed, but asking to hack facebook, instagram, etc. is NOT allowed. Also if you ask "how to become a hacker" and obviously have zero knowledge on anything related to that you may get warned or banned. * Legitimate requests for help on code and programming questions are welcome. A request is considered legitimate if it describes your problem, what you've done so far and what went wrong. Requests such as "write my program" or "do my homework" are never considered legitimate. Asking not legitimate questions will result in a warn or ban. See https://stackoverflow.com/help/mcve on how to write good questions. * Asking for book recommendations is ok, but "pls give pdf book" is not allowed, find books by yourself. Posting illegally copied books (or links to those books) is also not allowed and will get you BANNED. * Only English language is allowed, if you speak shitty English or don't understand anything in English YOU WILL BE BANNED. * A little bit of programming related memes, jokes, shitposting are allowed. * NSFW content (porn, nudity, etc.) is not allowed. * Spamming/advertising (job posts are also ads, so ask an admin before posting) will grant you a warning or an immediate ban if you do it right after joining. * Religion, politics and ideological topics are forbidden. * Long code snippets must be posted via a snippet website(links below), posting pictures of code and posting long snippets in the group is not allowed. * If you encounter a problem, while using dev C++ or turbo C/C++, you will not be helped, use another more modern IDE. * Don't post compiled executables, that is obviously a security risk. * Personal messages without asking beforehand are not allowed. * If you want to post a link or some article in this chat you will need an admin approval first ## Resources C/C++ group India: http://t.me/c_cpp_india About asking good questions: * [English](http://www.catb.org/esr/faqs/smart-questions.html) * [Translations](http://www.catb.org/esr/faqs/smart-questions.html#translations) For posting long code snippets: * [GitHub Gist](https://gist.github.com) * [Ubuntu Paste](https://paste.ubuntu.com/) * [Pastebin](https://pastebin.com) ## Reports If you notice any forbidden content, please use the /report command while responding to the offending post to report it to the admins.
Also you might want to read the rules which have a SPECIFIC section about it.
Ale
Usually that leads to a instaban :P
Thanks for the advice Tobias
PGaurav
GUI for C
PGaurav
I want to make a project for college But I don't know what to make
Anonymous
I want to make a project for college But I don't know what to make
U know for GUI , there are better languages than C..
PGaurav
I know but I have C as a subject in my college
PGaurav
And i need to submit a project
Vlad
Should it be GUI tho?
PGaurav
No It shouldn't but I was thinking adding GUI would be great
PGaurav
and Learning GUI in C would polish my skills in C
Vlad
Fixed
PGaurav
What should I do?
Vlad
What should I do?
Well you can write a lot of projects in C
Vlad
Also your gui may easily not be in C
Vlad
You can use C for the "meat" of your application
PGaurav
No No I am supposed to use entirely C
Vlad
No No I am supposed to use entirely C
What type of project are you planning to do?
PGaurav
I have no idea
PGaurav
I am thinking maybe a game or sth
PGaurav
I don't know 😔
Vlad
I am thinking maybe a game or sth
Well in game you don't need gui that much
Vlad
Also C bindings for ImGui exist
PGaurav
I wanted to add GUI to make it appealing
PGaurav
I have made Tic-tac-toe console based
Vlad
I wanted to add GUI to make it appealing
That's what graphics are for :P
Vlad
I have made Tic-tac-toe console based
If it's a simple game use SDL and call it a day
PGaurav
I have also started a project Payment system
PGaurav
@VoidStar0x0 You're a C programmer?
Anonymous
I have just started learning C++ . Its been a week that i have started learning . Can you guys recommend a free course which will help me in learning C++ .
PGaurav
I think you should watch Freecodecamp videos
DEV 7
#include<iostream> using namespace std; class student{ int scores[5]; public: void input(int, int, int, int, int); int calculateTotalScore(); }; void student::input(int a , int b, int c, int d , int e){ scores[0]=a; scores[1]=b; scores[2]=c; scores[3]=d; scores[4]=e; } int student::calculateTotalScore(){ int sum; sum=(scores[0]+scores[1]+scores[2]+scores[3]+scores[4]); return sum ; } int main(){ int n,a,b,c,d,e; cout<<"total students"<<endl; cin>>n; class student obj[n]; for (int i = 1; i <= n; i++) { cout<<"enter the marks of "<<endl; cin>>a>>b>>c>>d>>e; obj[i].input(a,b,c,d,e); obj[i].calculateTotalScore(); } return 0; }
DEV 7
why calulatetotalscore function not run ?
Kishore
What is meant by hidden test case?
Kishore
I am solving c++ programs and did output too
Kishore
But after that I submit my code that displays as hidden test case!
Kishore
Anyone?
Cris
No No I am supposed to use entirely C
C is already difficult enough, start with your assignment/project, then when you are done with the essential part you can think of adding a GUI
Puspam
What is meant by hidden test case?
The test cases which are kept secret. It is just to ensure that you can't cheat by looking at the test cases and write exclusive conditions for those!
Kishore
I am beginner I don't know how to do that
Puspam
I am beginner I don't know how to do that
Write your code in such a way that it works for any general input.
Kishore
Okay thank you dm you?
Sandeep
Int *idx=upper_bound(Y,Y+n,X); Here Y is an array... Int ans=(Y+n)-idx; Idx is an adress then for ans to be number of elements in between we need to divide it by size of int no?? Why is it still giving the correct ans
.
#include<stdio.h> #include<conio.h> void main() { int h=0,m=0,s=0; printf("enter a time formate in HH:MM:SS"); scanf("%d%d%d",&h,&m,&s); start: for(h;h<24;h++) { for(m;m<60;m++) { for(s;s<60;s++) { printf("%d:%d:%d",h,m,s); if(h<12) { printf("AM"); } else { printf("PM"); } for(double i=0;i<3619999;i++) i++; i--; } s=0; } m=0; } h=0; goto start; return 0; }
Puspam
Show error please help
Show the error message please
Talula
Please solve it
Solve what? I don't even know what your program is supposed to do.
.
🆗
touhou
Show error please help
Dude , you have to show the error msg. Lol
.
Problem solved
Anonymous
Int *idx=upper_bound(Y,Y+n,X); Here Y is an array... Int ans=(Y+n)-idx; Idx is an adress then for ans to be number of elements in between we need to divide it by size of int no?? Why is it still giving the correct ans
When you subtract two pointers within the same array (or one past the array) the resultant type is ptrdiff_t which indicates the number of elements of the type that the pointer points to in the range. You dont have to divide it by sizeof(<element type>).
Anonymous
When do I have to divide by type then
When you deal with bytes. For ex sizeof returns the number of bytes used for object representation in memory.
Anonymous
His is it possible to run two loops simulateously? It's for a race simulation.
smene
His is it possible to run two loops simulateously? It's for a race simulation.
You don't need to. https://stackoverflow.com/questions/11529580/how-can-i-run-two-loops-simultaneously-c
Nameful
Is there a data structure that holds N element and pushes older ones back when a new one is added, but never grows and just drop the oldest element when it gets full?
Nameful
you mean queue?
that sounds right
Hanz
that sounds right
Deque in Python
Nameful
https://docs.rs/queue/0.3.1/queue/struct.Queue.html
Hanz
just understand it and try to implement it in C/C++
Nameful
this looks like what I want. specifically, force_queue
Nameful
thanks
Hanz
yoi
Nameful
yoi?