General C++ Programming - March 2020 (Page 4)

without windows functions, can i get the key state?
 
i'm using a loop for get a pressed key: #include <graphics.h> #include <conio.h> #include <stdio.h> #include <string> #define KEY_UP 72 #define KEY_DOWN 80 #d...
[4 replies] Last: this looks like gaming stuff. gaming stuff may prefer to use directin... (by jonnin)
Classes
 
I have this assignment but I am not sure how to do it. voidStringC::operator*=(constinti) { ... } Implement the “in-place”multiplication opera...
[2 replies] Last: > the string should be duplicated “i”times ¿so "a" * 3 will giv... (by ne555)
Searching thru files
 
Hi, Would you please help me... I have below code and it only search the first line.. I think I am missing something or my code is wrong... My goal is to...
[5 replies] Last: Well searching through Temp.txt is going to be a right royal PITA beca... (by salem c)
by glixy
lab assignment help (functions & arrays)
 
I need some help with this C++ assignment. Any help would be appreciated, thank you! Assignment: You are provided a function (RollDice) that will give th...
[1 reply] : [quote=glixy]This is what I have so far. Nah. You took it from here,... (by lastchance)
how to create a multi vulnerable code with info leaks in windows 10?
 
I am trying to create a poc in order to achieve the following vulnerabilty bug class in my code for my research porpuses based on the top 25 from cwe I got the ...
[2 replies] Last: Cross-posted: https://stackoverflow.com/questions/60717376/how-to-crea... (by George P)
How do I copy the structure which has both string and integer into a char array in C++?
 
I want to generate hash of struct prop so for i need to copy the structure into a byte array and pass it to md5 function of openssl. I want to know how to copy ...
[9 replies] Last: oh, he said char array in the title but used string; mine won't work w... (by jonnin)
Why isn't this string comparison working?
 
So let's say that you are getting user input with getline() string userInput; getline(cin, userInput); if (userInput == "Hello World!") cout << "S...
[13 replies] Last: Make a completely new project, then paste in the code in jlb's post. C... (by Ganado)
Unwritten article about checking the Small Device C Compiler
 
SDCC is a retargettable, optimizing standard C (ANSI C89 / ISO C90, ISO C99, ISO C11 / C17) compiler that targets a growing list of processors including the Int...
[no replies]
by doggi
undefined reference to `jsonxx::Object::Object()'
 
I have to use jsonxx library in my project. But calling this line jsonxx::Object out; throws an error - `undefined reference to jsonxx::Object::Object()'` and `...
[15 replies] Last: I figured out that had to use cmake. It worked! Thank you everyone! (by doggi)
How to access elements of a const char*
 
I have this code: void GetLetter(const char* inputString) { cout << "The 1st letter is " << inputString ; } How do I do something like that? ...
[2 replies] Last: #include <iostream> char GetLetterByIndex(const char *inputString, ... (by fewdiefie)
Converting file handling to linked list
 
Hi Sir, I am new here. I need your help in converting below to linked list. Would you know how to do this? Thank you in advance void read (){ ifstream i...
[5 replies] Last: struct Node { int data; // for example Node *pNext;... (by fewdiefie)
Why doesn't a static cast work here?
 
Let's say that you are trying to check which object is which. #include <iostream> using namespace std; class Fish { public: virtual void FishType(...
[2 replies] Last: static_cast<new_type>(expression) 2) If new_type is a pointer or re... (by fewdiefie)
by zongul
You cannot use 32-bit time_t (_USE_32BIT_TIME_T) with _WIN64
 
I want to migrate from 32 bit to 64 bit and get the error from the title. I am working on visual studio 2012 and I do not know how to solve this.
[2 replies] Last: The error is saying that _USE_32BIT_TIME_T is defined (but why?) somew... (by dutch)
Using multiple cores
 
I'm just looking for some quality information about writing code that uses multiple cores. I'm not sure where to start. Initially, I want to be able to parse da...
[9 replies] Last: @dhayden's point is key here, so I'd like to underscore it a bit. Som... (by Niccolo)
by hmarid
From QBASIC to C++
 
Hi I have this subprogram in qbasic and I want to convert it in to c++ function. I need your help to do it. The sub look like this: SUB CO2NAS (zt, zp,...
[4 replies] Last: Yes it is mine ! Thank you . I appreciate your help. Solved (by hmarid)
help with function str cmp
 
hi, I am trying to recreate the strncmp function without actually using the function from the library I have to come up with the solution.so far i can compare t...
[2 replies] Last: It would be a lot easier to read this code if you used S1 and S2 ins... (by dhayden)
How to concatenate two const char*?
 
Let's say that you have a const char*, and you want to add it to another const char* const char* word = "hello "; const char* word2 = "world"; word += word2;...
[3 replies] Last: Pretty unlikely he meant that. Here's a good tip for the future; we c... (by Repeater)
How to convert an object to a string?
 
So let's say that we have a class called Date for example. And you want to convert an object of a date to a string, so you can do this: Date holiday; std::co...
[2 replies] Last: But this isn't working. How do I fix this? In your particular code... (by Repeater)
Running clock? Subtracting gas?
 
I'm in need of help writing my clock function. While my car is on, gasoline will be subtracted by 0.05 gallons every 1000 milliseconds. My issue is setting up t...
[3 replies] Last: clock_t begin_time = clock(); //note: not a constant while (1) { c =... (by ne555)
any ideas
 
you are required to design and implement a data structure that works like an array . it minimizes the use of memory and supports the following operations: a- p...
[3 replies] Last: You can fake an array using a linked list. struct s{int v; int loc; st... (by salem c)
March 2020 Pages: 1234567
  Archived months: [feb2020] [apr2020]

This is an archived page. To post a new message, go to the current page.