|
Message Closed
modified 29-Oct-18 13:11pm.
|
|
|
|
|
This is not good idea, because when the app doesn't have the focus, this trick doesn't work ...
|
|
|
|
|
|
double a = -60 ;
double b = -7500
bool flag;
if (a < b)
{
flag = true;
}
For the above check flag is getting true, it is not supposed to, how can I make the double negative comparison?
|
|
|
|
|
Comparison of double values behaves as expected, of course (and, as it stands, your code doesn't compile): the program
#include <iostream>
int main()
{
double a = -60 ;
double b = -7500;
bool flag = false;
if (a < b)
{
flag = true;
}
std::cout << std::boolalpha << flag << std::endl;;
}
ouptus
false
|
|
|
|
|
It is because your Quote: bool flag; was NOT initialized and contains garbage that is treated as true just because it is not zero.
Try:
double a = -60 ;
double b = -7500
bool flag = (a < b);
|
|
|
|
|
Am trying to use the clistctrl class using c++/MFC and Microsoft Visual studio 2017. I have designed a report style control with four columns. I am unable to display columns two through four. Am using InsertColumn method to establish the columns, the insertItem method to display the first column and the SetItem method to display columns two through four. I have followed the examples from all around the internet. Only the column headers & the first column are displayed. Is there anyone out there that has gotten this to work? If so could you reference the successful code.
|
|
|
|
|
I use CListCtrl since two decades and never had any problem with the report style...
Could you post your code?
|
|
|
|
|
Are you calling SetItemText for each column?
|
|
|
|
|
Do you need to adjust the column width? Without showing your relevant code, it's anybody's guess.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
hello i have a project of creating a 2D game with the c but i do not know how to start anyone can help me please
the game name is block puzzle
|
|
|
|
|
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
Try it yourself, you may find it is not as difficult as you think!
If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Hello, Maybe you did not understand what I asked, I did not ask you to do my homework, I meant I need someone to help me and give me some useful sites that can help me because I'm a beginner ok where do you see that I asked someone to do my project
|
|
|
|
|
sabrina life wrote: I need someone to help me and give me some useful sites that can help me because I'm a beginner So you can turn in someone else's work as your own? Erroneous assumption on my part, you say? Doubtful, but I will be glad to admit if I am wrong.
Am I correct in assuming this is not your first assignment? As such, the assignments prior to this should have prompted you to create a foundation for which to build, assuming you paid attention in class and did all of the work yourself. Short of looking up API documentation, the WWW should be the last place you should go for help. With a seemingly endless supply of data and information, it's actually making each successive generation less smart than the generation before. Once you figure out why that is, you can actually stop the trend.
There will always be coat tails to ride. Every now and again a person will get tired of that scenery and will decide to wear his/her own coat.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
modified 22-Oct-18 13:44pm.
|
|
|
|
|
yes you are wrong This is my first assignment i’m a student but i wanted to learn how to create games and I was hoping that i can find someone who have experience and discuss with him how can I start and what should i learn first Because I have never created a game and I want it to be the first time but I was wrong to came here assuming that someone can lead me and give me advices but I will lead myself thank you very much for your help
But i learned that your best teacher is your last mistake
|
|
|
|
|
sabrina life wrote: This is my first assignment
No, it isn't. No teacher throws you "in at the deep end" and tells you "how to compile, now write a game". It generally starts with "hello world" and ramps up from that.
So use what you learned from your previous assignments - you did do those, didn't you - and apply it to the current one.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I told you this is my first game with c i learned the c without a teacher only videos and useful sites because i love programming and now this game is my own project that why i wanted someone just to guide me how to start ,ok this is the story
|
|
|
|
|
Then you have made at least two mistakes.
1) You have picked up bits and bobs from videos without any structure or real explanation of why you do that - and for a language like C the "Why?" is far more important than the "How?". Plus most development videos on YouTube are created by people who know little more than you do, and couldn;t teach if their lives depended on it ... Get a book (or better a course) and follow it from beginning to end, doing all the exercises. It may not be as exciting as jumping into code, but it is a much, much better way to learn - and you don't miss out essentials either!
2) You picked the wrong "beginner language" - I'd strongly suggest you shelve C for the moment, and start with C# (or even VB if you must) and get a solid grounding in development using that - it's a lot easier for a beginner, despite seeming to be much, much bigger and more complicated. In fact, it shows you up front how big and flexible it is, and makes the beginner (and expert!) developer's life a whole load easier by hiding the complexities of C behind the scenes where you don't have to worry about them. Get a good book on C# - Addison Wesley do good onew, as do Wrox and Microsoft Press - and a copy of Visual Studio (free from MS!) and follow it through all the way.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
thank you very much i really appreciate your help
|
|
|
|
|
|
You need to find the maximum possible side length of the base of the garden such that the total cost of removing residential plot does not exceed B.
Input Format
Input 1: It will be string which tells two integers separated by a single comma that represent M and N respectively.
Input 2: It will be the integer B, the maximum cost you can afford (i.e., your budget). It is the cost of removing ith plot.
Input 3: It will be the integer P, the residential plots found in the list.
Input 4: It will be string array where:
The first line of the array tells the total number of elements in the array i.e.
Each of the next P lines describes a residential plot. The ith of these lines describes the ith plot. Each line consists of 5 integers: Xi1, Yi1, Xi2, Yi2, and Ci separated by single comma. They represent respectively the coordinates of the bottommost, leftmost cell of the plot, the coordinates of the topmost & rightmost cell of the plot, and the cost of removing the plot. The bottommost, leftmost cell on the grid has coordinates (1, 1) and the topmost, rightmost cell has coordinates (M, N).
1 <= Xi1 <= Xi2 <= M, X coordinates of the leftmost and the rightmost cells of the ith residential plot
1 <= Yi1 <= Yi2 <= N, Y coordinates of the bottommost and the topmost cells of the ith residential plot
Constraints
1 <= M, N <= 1,000,000
1 <= Ci <= 7,000
0 <= B <= 1,00,000
1<= P <= 1,00,000
Output Format
It will be an integer that tells the maximum length of the base of the garden such that the total cost of removing plots does not exceed B.
Sample TestCase 1
Input
6,9
42
5
5
4,1,6,3,12
3,6,5,6,9
1,3,3,8,24
3,8,6,9,21
5,1,6,2,20
Output
4
Explanation: two possible locations for the garden base, both having a side of length 4 which is the maximum possible length of the base of the garden. Hence the output will be 4.
Sample TestCase 2
Input
6,9
0
5
5
4,1,6,3,12
3,6,5,6,9
1,3,3,8,24
3,8,6,9,21
5,1,6,2,20
Output
Code:
#include <iostream>
#include <bits stdc++.h="">
using namespace std;
typedef long long int ll;
typedef long double db;
int main()
{
ll n,m;char ch;ll i,j,k;
cin>>n>>ch>>m;
ll a[n+1][m+1];
ll cost,plots,ui,r1,r2,c1,c2,plotcost;
cin>>cost>>plots>>ui;
vector<ll> costv;
costv.push_back(0LL);
ll mp[n+1][m+1];
for(i=1;i<=n;i++)
{
for(j=1;j<=m;j++)
{
mp[i][j]=0;//<<" ";
}
//cout<<endl;
}
="" while(plots--)
="" {
="" cin="">>r1>>ch>>c1>>ch>>r2>>ch>>c2>>ch>>plotcost;
costv.push_back(plotcost);
ll yu=costv.size()-1;
for(i=r1;i<=r2;i++)
{
for(j=c1;j<=c2;j++)
{
mp[i][j]=yu;
}
}
}
ll len;
ll maxlength=0;
ll l;ll s=0;
//cout<<n<<" "<<m<<endl;
=""
="" for(len="1;len<=6;len++)
" {
="" for(i="1;i<=n-len+1;i++)
" for(j="1;j<=m-len+1;j++)
" ll="" costsum="0;
" set<ll=""> se;
for(k=i;k
|
|
|
|
|
- Please properly format your code.
- What was the "runt time error"?
|
|
|
|
|
It is not passing all the test cases. When I try to compile it in IDE without custom input it's showing run time error.
|
|
|
|
|
|