
please wait
by PK Dey
inline function
|
The following code gives same result whether "inline" present Or not. Then what is the purpose of "inline" in the following purpose? #include<iostream> ... |
Apr 4, 2021 at 4:10pm
[6 replies] Last: inline is just a suggestion to the compiler. [quote=cppreference]The... (by deleted account xyzzy)
|
by hbcpp
Prevent computer from sleeping in Linux
|
I need a way to prevent the computer from sleeping, turn it on/off at runtime. I believe SetThreadExecutionState https://docs.microsoft.com/en-us/windows/win... |
Apr 4, 2021 at 2:27pm
[11 replies] Last: @jonnin You can read here https://docs.microsoft.com/en-us/windows/wi... (by hbcpp)
|
by aminmax
Provide a proper variable
|
how should I right a variable in int gindex (unsigned int PC, int bank, long long hist, folded_history * ch_i) for "folded_history" class folded_history... |
Apr 4, 2021 at 1:08pm
[4 replies] Last: typically a pointer is initialized to one of 3 things: nullptr keyword... (by jonnin)
|
by akeilo
Needing help with my loop
|
I was wondering how I could fix this loop to keep asking the user to input a number after the wrong number. I also am trying to figure out what I broke. Thank ... |
Apr 4, 2021 at 11:05am
[3 replies] Last: Hello akeilo, Here is something to think about: #include <iostream>... (by Handy Andy)
|
by hbyte
My Easter Algo - Scrappy Genetic Algo
|
(S)crappy Genetic Algorithm! Visualise solving Styblinski–Tang function This is the Scrappy GA algo. A quick and dirty GA written to be used for Injecting ... |
Apr 4, 2021 at 8:59am
[no replies]
|
by ericM
pass template object to function
|
I am using several histogram objects (from boos::histogram). I would like to pass these histograms to a function, to handle my program output outside my main.cp... |
Apr 3, 2021 at 10:15pm
[3 replies] Last: As a simple curiosity, how do I make sure that T implements the requ... (by mbozzi)
|
by samzavax
2d matrix problem
|
Array (a) consists of 5 rows and 5 columns. int a [ ][ ] ={{2,-5},{3,6,1,-4,2},{8},{9,2,1,2,9},{4,-6}}; a. Write a C++ code that stores the value 50 instead ... |
Apr 3, 2021 at 9:19pm
[6 replies] Last: Hello samzavax, Like I said first show me how you would print the arr... (by Handy Andy)
|
by Pepeforever
Whats wrong with my code?
|
Whats wrong with my code? #include <iostream> using namespace std; int main() { int x,y; cin >> x, cin >> y; do { cout << "the smaller v... |
Apr 3, 2021 at 11:22am
[10 replies] Last: Hello Pepeforever, I think it is time to go back to the beginning and... (by Handy Andy)
|
by NiceS
File getting deleted instead of appending
|
Im trying to create a function that checkout a tool for a user when called, currently my entire checkout file is getting deleted and not getting appended. The ... |
Apr 3, 2021 at 11:02am
[7 replies] Last: outFile.open("tools.txt"); This will delete the tools.txt file da... (by seeplus)
|
Trying to assing a value of a static member of a struct |
So i have a simple struct with only a single static varialbe as shown below: struct X{ static int k; }; int main(){ X::k =2; } This does not ... |
Apr 3, 2021 at 10:20am
[4 replies] Last: @seeplus thanks man you are a life saver (by Kallinteris Andreas)
|
by av16352
Unable to print user input in quotes
|
Hello so I'm writing a program that converts decimal to binary format but can't seem to print the user input in quotes. For example I want to print; The numbe... |
Apr 3, 2021 at 4:02am
[1 reply] : cout << '\"'; before and after the for loop, not inside it.... (by Ganado)
|
by samzavax
loop problem
|
I have a project for programming course, I wanted to make a program where I use loop (while, do while, for loop) to book seats for movies in the cinema. the pro... |
Apr 2, 2021 at 6:32pm
[2 replies] Last: thank you for your help! I put the code and run it but in the end of t... (by samzavax)
|
by patCplusplus
Address of function will always return true
|
Hello, I am new to this forum and C++. I am testing a function that will do something if another function is called or not. Here is what I have but it is givin... |
Apr 2, 2021 at 6:17pm
[7 replies] Last: Thank you so much. Using the c was a better approach and it worked. Th... (by patCplusplus)
|
by PK Dey
t1, t2, t3 undefined
|
when i run the following code it is showing that t1, t2, t3 are undefined! But think they are object of class time. Then why is it showing that t1, t2, t3 are u... |
Apr 2, 2021 at 5:17pm
[2 replies] Last: Because time is a standard c function. - which is probably being inclu... (by seeplus)
|
by qtngmin
Unknow error
|
I have this code below implement a simple Virtual Machine to load instruction and do things to data. The problem is the exception I throw when meet a " " at the... |
Apr 2, 2021 at 1:27pm
[9 replies] Last: There is a place in your code where you most likely are doing: throw ... (by Ganado)
|
by frueda75
I need to figure out how to declare variables but my professor is not explaining correctly and can barely understand her
|
#include <iostream> #include <ctime> #include <cstdlib> #include <algorithm> using namespace std; // Funtion prototypes: int getInput(); int findMin(... |
Apr 2, 2021 at 10:37am
[4 replies] Last: how to declare variables See tutorial: http://www.cplusplus.com/doc/... (by keskiverto)
|
by ObscurityT
Ternary Operator in this function
|
Hello, I was searching for a solution to a challenge and this was one of the answers, but I can't understand the for(int y:arr). What does it mean? Thank you fo... |
Apr 2, 2021 at 8:30am
[3 replies] Last: It's not good code though - as arr is passed by value not by const ref... (by seeplus)
|
How can I increment elements of a vector(or array)? |
Adding to this 'example' would be appreciated : int x = 1; std::vector<int> children{}; int dog = 10, cat = 10 do { cat--; dog--; if (cat == dog)... |
Apr 2, 2021 at 2:50am
[12 replies] Last: @seeplus, yes that was the point, I really did not understand how I co... (by possum swallower)
|
by bjkling15
Printing private class array data
|
I want to get data from an objects array and print it using "cout". Having trouble figuring out how to implement this. I have an array of pointers "classRosterA... |
Apr 2, 2021 at 1:45am
[3 replies] Last: > Why is your Student object called a 'classRosterArray'. That doesn't... (by ne555)
|
Unrecognized syntax in sample code |
I did a bunch of C++ programming back in the 1980s and early 90s, but not much since. In trying to program a CoreAudio application, about 10 years ago I found t... |
Apr 2, 2021 at 12:14am
[2 replies] Last: Thanks! Yes, I'm old enough to have read "Goto considered harmful", so... (by Steve Frysinger)
|