General C++ Programming - July 2022 (Page 3)

by frek
The type of sting literals (1,2)
 
What is the type of string literals, say, "Hello", in C++, please? Is it a const char* as Stroustr...
[22 replies] Last: and also: auto str {"hello"sv}; where str becomes a std::string_... (by seeplus)
by zsess
How do I get this to only output the userinput that it finds.
 
#include <iostream> #include <string> // Note: This library is needed to use the string type using...
[4 replies] Last: Using arrays, then possibly something like this - where it is easier t... (by seeplus)
by ruzip
Looking for a LoadLibrary C example that works with GCC
 
So far I found this: http://www.sharetechnote.com/html/C_LoadLibrary.html Removed stdafx.h Added ...
[3 replies] Last: LoadLibraryA means you're compiling as ASCII and not unicode. Hence st... (by seeplus)
by ruzip
Linking FreeGlut Static Library to DLL
 
Basically I would like to link FreeGlut static library and include it in my project DLL. I'm gettin...
[4 replies] Last: Ok thanks kigar64551 , will try the trace option. (by ruzip)
by ruzip
Using Static C++ Library in C
 
I'm having problems linking a static C++ library in C. I have already done it with shared library a...
[10 replies] Last: Keep in mind that programs like gcc and g++ are so-called "drivers... (by kigar64551)
Copying from txt file to parallel arrays using pointer
 
I am trying to use parallel arrays to store cards information . Firstly use a function that reads al...
[8 replies] Last: Maybe something like this: #include <iostream> #include <fstream> #... (by seeplus)
How to split a string according to "|"
 
hello everyone, I have a problem with split in c++11,this is my code in main: string str = "AA...
[5 replies] Last: Using C++20 ranges: #include <vector> #include <ranges> #include <i... (by seeplus)
Prj Hlp
 
Hello This is the code that I've addressed last time and I made a new one and made a new code and cu...
[4 replies] Last: Part 3: int main() { movieList movie; movie.OpenMovieFile(); mo... (by seeplus)
by BigBen
Saving a vector of objects
 
I have a vector of objects of a class. It is a class with a large number of different types of membe...
[3 replies] Last: As others have said, your problem is mostly about how to write (read) ... (by keskiverto)
how does the program get to the next line or next char? ?
 
Hi, how does getline reads the 2nd line if getline function is called again since it doesn't have a ...
[2 replies] Last: > how does getline reads the 2nd line if getline function is called a... (by JLBorges)
Project Help
 
Hello I've been working in the code and I need to modify the code below My concern are the follow...
[6 replies] Last: okay tnx for that. I'll try to work on it. (by closed account 3RGNvqkS)
by frek
Determine whether a triangle can be built from a given set of edges
 
Here's the task: https://app.codility.com/programmers/lessons/6-sorting/triangle/ And here's a simpl...
[9 replies] Last: @Duthomhas You mean applying a non-comparison sort algorithm for both ... (by frek)
need assistance! Write a program that reads students’ names followed by their test scores.
 
Been having a lot of bugs with this code and can't really figure out why. Any help would be appreci...
[4 replies] Last: https://stackoverflow.com/questions/1452721/why-is-using-namespace-std... (by deleted account xyzzy)
by ruzip
Encode integer value to 4 bytes in a file
 
I'm trying to encode data into a file in binary mode. It should be 4 bytes with an integer value. ...
[7 replies] Last: It's not usually necessary to test your machine's byte order, because ... (by mbozzi)
My program keeps getting zero as an answer
 
I am writing a program as homework that gets input from the user for the calories in a food and the ...
[1 reply] : [quote=lexicution17]I keep getting 0 as an answer for the percentage ... (by deleted account xyzzy)
Need assistance with this code please!!
 
Instructions: The history teacher at your school needs help in grading a True/False test. The studen...
[7 replies] Last: we're not allowed to use strings like you use, we have to use chars ... (by seeplus)
by ruzip
Change Insertion Operator Symbol by Macro?
 
Hi, I would like something like: cout "Hello " + mystr + ".\n"; instead of the standard << sym...
[14 replies] Last: The term POD is no longer used by the standard, and its type traits (... (by Duthomhas)
by t im
About the cmp in priority_queue
 
I want to define the cmp in priority_queue by myself, the code is as follows: auto cmp = (const...
[1 reply] : > Why should I use decltype(cmp) The type of cmp - the closure typ... (by JLBorges)
July 2022 Pages: 123
  Archived months: [jun2022] [aug2022]

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