RØB
Salwa
Hi i want to ask something. I make a change on my code, but when i run, the compiler seems to compile the code before the change. I tried several time but it still show the same output. How can i solve this? I already try to uninstalled and install the program.
Shahrukh
Salwa
Already done it but still with the same output
Shahrukh
Pavel
AmR
I need some help with cmake, Can I asking about it >?
Anonymous
really??😱😳
Chinepun💛
AmR
@Chinepun Here ?
AmR
@Chinepun I need some help to use SOCI project, I want add some sqlite3 lib to be build 1st and then config soci to use that local lib, I want use that as https://github.com/utelle/SQLite3MultipleCiphers lib, I think in it like this I will write cmake script sqlite3 and add some how to export it's namespace as SQLITE3 and then before include soci I add that lib in main cmake script to let SOCI lib use it as dependencies, But The Q how to that ?
Chinepun💛
AmR
@Chinepun yes
Chinepun💛
You will have to write one yourself and if you need help, them we can help you out
AmR
@then How I can make cmake see my sqlite3 lib as the lib it willl use
Chinepun💛
Start a YouTube tutorial on how to write Cmake script
Chinepun💛
If you understand the structure of C++ files, it should not be a problem
AmR
@Chinepun I know some CMake, And Write my Main one
Chinepun💛
Then what problem do you have?
AmR
@Chinepun I need to tell cmake to use my local sqlite3 lib not one that in the system
Chinepun💛
AmR
yes
AmR
My project like that
cmake -> mainApp -> soci
AmR
not that sorry
AmR
@Chinepun 1 : cmake -> 2 : mainApp -> 3 : soci -> 4: use sqlite3 from system -> 5 : local sqlite3 lib . I want override steep number 4 from outside soci in main cmake script by number 5
Serkan
Does pasting service is allowed, or not ?
Andre
Hi. I need to write a custom string generator with some skipping rules from charset.
I googled a little and found this one "geeksforgeeks org/ generate-all-possible-combinations-of-at-most-x-characters-from-a-given-array/"
It's good for a small total length and small charset length, but sucks with a big ones. Huge memory usage.
Please, point me out, how should I optimize this algo?
I found a swap algo, but it swaps chars with provided length in line, not custom total string length. Maybe I can modify it somehow?
I use std::ofstream to save in file (not every line), but I still has all the array in memory.
Also, I noticed, that this loop "// Traverse all possible lengths" (link above) generate all combinations from the beginning. For example, if I need 6 chars length, it will also generate 1-5 combinations.
Serkan
Okey, I did not want it to share as directly here but it seems there is on way around.
I use VS Code to code C (I am new to C)
Which line I should change in order to compile multiple c code at the same time.
// tasks.json in VS Code
{
"version": "2.0.0",
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: gcc.exe build active file",
"command": "C:\\MinGW\\bin\\gcc.exe",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": "build",
"detail": "compiler: C:\\MinGW\\bin\\gcc.exe"
}
]
}
Nomid Íkorni-Sciurus
Hi,
I have a threaded libcairo win32 surface:
HDC hdc = GetDC(vt->hwnd);
vt->canvas = cairo_win32_surface_create_with_dib(
CAIRO_FORMAT_RGBA128F,
vt->width,
vt->height
);
for (;;) {
draw(vt);
BitBlt(
hdc,
0,
0,
vt->width,
vt->height,
cairo_win32_surface_get_dc(vt->canvas),
0,
0,
SRCCOPY
);
Sleep(delay);
}
For some reason, cairo_win32_surface_get_dc() is throwing access violation.
This doesn't happen everywhere else, so I'm guessing it has to do with its internal dib object.
What would you suggest me to do?
klimi
So you want C++ compiler code? if you are just hoping that someone will magically hang you the c++ represantition of that program i would say you are really mistaken. Please solve assigments on your own
redfox
#include<iostream>
using namespace std;
class Base {
public:
virtual void display() {
cout<<"I am a Base Class"<<endl;
}
};
class Derived: public Base{
public:
void display(){
cout<<"I am a Derived Class \n";
}
};
int main(){
Base *p = new Derived;
p->display(); // Envoked suring runtime
return 0;
}
hi i have started learning polymorphism and as i was reading some programs trying to understand how it works when i came across 3 main things that i wasn't able to understand in the code i was reading
1) in the class Derived: public Base why are there " : " and a " public Base " i do not get why it was written that way
2)in the Base *p = new Derived what is "new derived" mostly what is new i get it that he is making a pointer but why " new "
3) lastly p->display(); what is the " -> " for i think it has something to do whit function overloading or virtual functions.
Leovan
AmR
Can any one help me with cmake override find_package ?
Prometheus
smene
Hi everyone, which http client would you suggest to use in cpp?
j. c o l e
Who can solve my problem for money?
Leovan
Prometheus
Figured that would be a good tidbit to add lol
Prometheus
j. c o l e
#include<iostream>
using namespace std;
class Test {
public:
int num, square, cube;
void input() {
cout << "Enter a number:";
cin >> num;
}
void findSquare() {
square = num * num;
}
void findCube() {
cube = num * num * num;
}
void display() {
cout << "Square is:" << square;
cout << "\nCube is:" << cube;
}
};
int main() {
Test obj;
obj.input();
obj.findSquare();
obj.findCube();
obj.display();
return 0;
}
j. c o l e
this is code
j. c o l e
i want to make cycle to repeat the program 10 times
Leovan
j. c o l e
program can't run 10 digits
Prometheus
program can't run 10 digits
What do you mean by it can’t run 10 digits? Also, are you required to use “using namespace std;”. Bad practice in the long run.
j. c o l e
j. c o l e
Prometheus
So the user enters all of them one at a time and then it’s processed?
j. c o l e
yes
j. c o l e
i cannot receive squares for all of them
j. c o l e
program gives me only for the first number
Prometheus
So have the user enter them into an array.
Int numbers[9], count = 0;
While (count != 9)
{
cin >> numbers[count];
count++;
}
count = 0;
While(count != 9)
{
//just run all math inside here using numbers[count] instead of num
count++;
}
Prometheus
There’s better ways to do it but when I was in college this would’ve sufficed. Waiting on my coffee to finish so there may be some mistype in there or something.
Anonymous
Exercise 1 - Hypotenuse of right triangles
Calculate the Hypotenuse of n right triangles. Find and show the biggest hypotenuse.
Input specification: You will be first given an integer (n), then in the following n lines you will be given two integers. The lengths of two sides of the triangles where n is between 0 and 2000. And sides are integers between 1 and 20,000.(sqrt is a function to calculate the square root of a number. For example, sqrt(9)3.0.Or,if num is 100,sqrt(num)gives 10).
Output specification: Show a floating point number with two-digits precision: the length of the biggest hypotenuse.
Solve the exercise using these functions: float hypotenuse(int a, int b);
float compare_hypotenuse(float h, float max); float getData_ShowResult(int n);
Anonymous
anyone has done this before?
coal
no i dont think i have done your homework before
Sarmat
Hi guys, do you have some tutorials/articles about creating a messanger with c++ backend and frontend (desktop application)
or maybe smth like that.
Krishnaa
#include<bits/stdc++.h>
using namespace std;
class stk{
private:
int i=-1;
public:
int size, a[size];
stk(int n){
size=n;
}
int sizeOfStk(){
return size;
}
};
int main(){
int n;
cin>>n;
stk s(n);
cout<<" stack size: "<<s.sizeOfStk();
return 0;
}
Krishnaa
\Device\NUL
\Device\NUL
Yet, please use pedantic on your compiler's flag, VLA is not in standard C++
\Device\NUL
https://www.quora.com/Is-it-good-practice-to-use-include-bits-stdc++-h-in-programming-contests-instead-of-listing-a-lot-of-includes
Krishnaa
Yeah thanks for the help
Krishnaa
I'll check this
Krishnaa
Krishnaa
\Device\NUL
Just read the message
Krishnaa
Ok bro thanks anyway.
Anonymous
How to start development in c++
Anonymous
Development: desktop application software
r3tr0m
https://pastebin.com/fR5P648K
Saad
Yess I read it and I’m agree with
Anonymous
hey, is there anyone who know javascript international group?
Parra
Hi everyone, I've created a new channel related to C/C++ advanced topics, feel free to join (thanks to the admins for letting me post it):
https://t.me/programming_deadlock
Arta
Hi
How good is C++ for backend programming?
Definitely always has something to say
But can it replace languages like php?
I know the answer is probably no
I have no experience in backend programming but I'm curious to know about c++ performance, how problematic are c++ security vulnerabilities?
klimi