Golden Age Of
Yigrem
/get
Aida Ataee
I would be thankful if you introduce a good website for learning C
Anonymous
Manav
/get
Kartik
/get
Abdurahmane
Hello ! I'm new in Qt. When I try to load an image i get this error message : QML Image: Cannot open: qrc:/imageTest.png
imageTest.png and the qml file are in the same directory.
import QtQuick 2.9
import QtQuick.Window 2.2
Window {
visible: true
width: 640
height: 480
title: qsTr("Test")
Image {
id: image1
x: 10
y: 10
width: 100
height: 100
source: "imageTest.png"
}
}
Abdurahmane
I'm using Ubuntu
Pavel
Abdurahmane
Now I'm wondering if I need to always define the paths of my resources manually in the qrc file or is there any way it can be done automatically.
Abdurahmane
Waouh just discovered that I can click on the qrc file and then use the add button to select all the files I want to add as resources. It's very easy ! No need to go a write xml in the qrc file.
Abdurahmane
It's ok for me.
Diypa
Hi
Diypa
#include <iostream>
using namespace std;
int main()
{
int player;
int s_hour;
int e_hour;
int SmallestNumber;
int winner;
cout << endl <<" ********** " << " \n Player nr ";
cin >> player;
cout << " Start hour: ";
cin >> s_hour;
cout << " End hour: ";
cin >> e_hour;
while (player > 0) {
cout << endl <<" ********** " << " \n Player nr ";
cin >> player;
if( player < 0) {
// terminate the loop
break;
}
cout << " Start hour: ";
cin >> s_hour;
cout << " End hour: ";
cin >> e_hour;
if (s_hour < SmallestNumber )
{
SmallestNumber = s_hour;
}
}
cout << "Smallest number is: " << SmallestNumber << '\n' << endl;
cout << " And the Winner is : " << player << '\n' << endl;
return 0;
}
Diypa
I have written this... but I have problem with get the winner number wich is player nr..
Diypa
Anyone knows what do it... recommendations please
Pavel
Diypa
Hi Pavel. I use -1 to terminate the loop. The smallest start hour will make the player a winner. I get the smallest number it works. But I cant get the player number.
Diypa
/ cant get this to work, // cout << " And the Winner is : " << player << '\n' << endl;
Diypa
I do appricate any help.
Ravi
Diypa
🌹🌹🌹 Thank you.. it is clear now to me
Diypa
Thank you very much
محمد
🌹🌹
🍥N00d1e5🍜
Hi guys, do you have any idea why fscanf return null please?
🍥N00d1e5🍜
I run the same code on an ubuntu and an opensuse, it works on OpenSuse, but not on Ubuntu...
🍥N00d1e5🍜
This is the code's repo:
https://github.com/dple/ecdsa/tree/a64c3b610591be34b6a6688c9b5004b60803efbe
🍥N00d1e5🍜
In the second step, it should read the priv256.pem, and get the first line with fscanf function.
But it returns null on my Ubuntu, but correct value on OpenSuse...
Ehsan
🍥N00d1e5🍜
Read the docs please
I am on that.
But I have no idea why it works on one Linux, but not on another...
🍥N00d1e5🍜
I don't know if I should install or replace any local library
🍥N00d1e5🍜
The code correctly initialise the value in the file ecdsa.c - line 605 by char curve[9];
and just one line below, fscanf(file, "%s", curve)
I cannot find any error
Besides, it works on another linux (OpenSuse)
z
Here the function signature
int fscanf(FILE *stream, const char *format, ...);
🍥N00d1e5🍜
which is line 326 and then line 329
🍥N00d1e5🍜
emmm sorry, it seems not the problem of fscanf, but some points else.
Working on it
数学の恋人
Guys is it good to use constructors with constexpr? I mean to say something like this,
class someClass {
private:
int a;
public:
inline constexpr someClass() : a(5) {}
};
数学の恋人
I don't think so it's needed and might come under bad practices too
Alejandro
Alejandro
Note that constexpr means that it can be used in constexpr and not in constexpr situations. It doesn’t disallow normal usage
Alejandro
It doesn’t mean that you should go crazy and add constexpr everywhere but if you suspect it may be used, better to do it.
Lots of std containers in the recent versions of C++ have been made constexpr :)
数学の恋人
数学の恋人
but when I want to do something like,
class someClass {
private:
int a;
public:
inline constexpr someClass() : a(5) {
std::cout << "Initializing a\n";
}
};
Compiler gives me warning, that is -Winvalid-constexpr
数学の恋人
but if I remove cout statement it is fine
Adam
//ge
数学の恋人
I think I'm using constexpr in wrong way
数学の恋人
constexpr will be used to generate constexpr and I'm giving it a freaking print statement in between that's why it's going wrong, nvm I understood what I'm doing wrong
Alejandro
Alejandro
since cout is not constexpr, then that doesn't work
数学の恋人
Yeah I got it, thanks for helping me out
🍥N00d1e5🍜
line 326 in ecdsa.c
🍥N00d1e5🍜
z
🍥N00d1e5🍜
I will try that, I just saved your message in my notes.
Really appraciate that.
Sachin
#include <stdio.h>
#include<string.h>
int main() {
int max=0;
char a[100];
scanf("%[^\n]s",a);
//fgets(a,99,stdin);
int l = 0,s = 0;
for(int k=0; a[k]!='\0' ; k++)
{
if(a[k] != ' ' )
l++;
else
{
if(l>max)
{s=k-l;}
max = max > l ? max : l ;
l=0;
}
}
printf(" %s ",a[s]);
}
Sachin
anyone
Sachin
?
Kartik
Remove
Sachin
then how should i input string
Kartik
Sorry my bad
Kartik
Yes
Kartik
Remove %s and write only s
As string is derived data type
Rahul
Anyone can tell. This WhatsApp group is also useful for anyone. Whether or not the message keeps running in vain. I have joined this group but I don't know anything. How to use it?
Sachin
Ishikawa
Talula
HaiNahi
klimi
HaiNahi
/warns
I want internship, I kept 1$ to filter uninterested
klimi
HaiNahi
I want free job I am in diploma college :)
klimi
HaiNahi
Yes
klimi
ok, great
klimi
but what do i have to do with that? quite.... nothing