General C++ Programming - September 2018 (Page 4)

How to use HANDLE VARIABLE from main in other cpp files (1,2)
 
Have a problem. - I am making a function for my struct called READPLAYERINFORMATION(); - Inside the definition is READPROCESSMEMORY(hProcess), hProcess is the...
[22 replies] Last: Another alternative: use ReadProcessMemory() from Player_t::ReadPlayer... (by helios)
Help me fix a LNK error
 
Severity Code Description Project File Line Error LNK2038 mismatch detected for '_MSC_VER': value '1800' doesn't match value '1900' in App.obj BasicScripting_...
[1 reply] : Perhaps ths page can help: https://stackoverflow.com/questions/1957574... (by Enoizat)
by Amaris
Understanding list::splice
 
The definition for iterator validity after list::splice operation: Iterator validity No changes on the iterators, pointers and references related to the con...
[4 replies] Last: #include <iostream> #include <list> int main() { using std::cou... (by tpb)
by ssol
How can I use the deleted pointer again?
 
I want to use a deleted pointer again so I did like this int* a1=new int; int* a2=new int; . . . delete a1; *a1=*a2; delete a2; but I got segment f...
[5 replies] Last: I had my suspicions in the earlier thread http://www.cplusplus.com/for... (by keskiverto)
by quete5
Fewest number of bills program
 
I think I'm mostly stuck on the math, but I can't figure out what I'm doing wrong. I'm trying to make a program that will let the user enter an amount of money ...
[2 replies] Last: Sorry, I'm new on here. How do I delete this post? The other one that ... (by quete5)
by quete5
return a specific character from a string?
 
Hi, I'm looking for a function call that will return a specific character from a string. I need to create a program that will ask the user for a word, ask fo...
[2 replies] Last: Thank you so much, I really appreciate it! I knew it was simple but I ... (by quete5)
Reading char by char from a file c++
 
Hi, I am trying to read each character from a file in c++, also,I need to get their ascii value, but I have a problem on the output, there are two characters el...
[3 replies] Last: > It is reading twice the last caracter Check for input failure after... (by JLBorges)
How to remove the 'k' number of elements in a linked list.
 
How to remove the 'k' number of elements in a linked list. I search the many sites on the internet but found nothing. Can anyone please give the link to ...
[1 reply] : probably because it doesn't make sense as a stand alone question. del... (by jonnin)
by tpb
operator<<(os, 42) vs os << 42
 
#include <iostream> using namespace std; // for this experiment int main() { operator<<(cout, 42); // ambiguous overload error; candidates offe...
[2 replies] Last: The << operators for outputting integers are defined as member functio... (by Peter87)
using string or char with if else statement
 
i want to programme like this but i dont know how to use char or string with if else statement: user will open this program and programme will say "do you wa...
[2 replies] Last: yes , now it worked thanks a lot for your help (by lethansnow)
cin and cout not working (invalid operand to binary expression)
 
I am working in CLion, just installed today and fresh. All default settings. This works fine: #include <iostream> using namespace std int main () { ...
[1 reply] : #include <string> (by JLBorges)
by ssol
why when cin is always 0?
 
in this code, int k; cin>>k if I type not int like 'a' or '\' they are all recognized as 0 and code is operated strangely why this happened??
[3 replies] Last: #include <iostream> int main() { int k ; std::cout << "enter... (by JLBorges)
by ssol
Is it right way to assign deleted pointer?
 
I want to assign a pointer to deleted pointer like this int *p = new int; int *q = new int; . (some code) . delete p; p=q; is it right??
[1 reply] : Term deleted pointer is misleading. You don't "delete pointer p". Y... (by keskiverto)
by LMG
Need help with powers/averages table
 
Here is my assignment: {Print out a table of powers. Use a for loop that goes from 101 to 112 inclusive. Print out r, r squared, r cubed, square root of r, a...
[3 replies] Last: What does "to self generate" mean? I did not state how to sum. I did ... (by keskiverto)
VS2017 & std::string_view - Undefined Identifier
 
I don't know if this forum is the correct place for this. Apologies if it's isn't. This seems to be more about the compiler than the language itself. I have ...
[17 replies] Last: And...now, it compiles and runs..... The problem seems to be solved b... (by closed account E0p9LyTq)
Stacks with Chars
 
Hello, I cant seem to get my code to work. Any advice? #include<iostream> using namespace std; class stack { private: char a ; int counter; pub...
[2 replies] Last: #include <iostream> using namespace std; class stack { // NOTE(mbo... (by mbozzi)
Find the mode of a Dynamic array with pointers
 
I need to figure out the mode(s) from a dynamic array that was populated using a text file and pointers. I also need to account for multiple modes. I am trying ...
[3 replies] Last: Referring to your original post: Line 115: this will return an integer... (by dhayden)
How to change the function to the linear time.
 
I have the following function that removes all occurrences of x (if any) in given list (calling object). Returns number of matches found/deleted and the relativ...
[1 reply] : The problem with remove_first(x) is that it has to search from the b... (by Duthomhas)
How to calculate the length of the linked list using constant time (O(1))
 
I have a function to calculate the length of the list. But this is in linear time. How could I convert this to constant time (O(1)) struct Node { T data; ...
[6 replies] Last: Oh, duh. Thanks. Fixed. (by Duthomhas)
by ssol
How to avoid multiple definition of memeber variable?
 
I got a multiple definition error of member variable In my header file, class A{ static int val; } . . int A::val=0; (I defined member variable and ...
[3 replies] Last: thanks guys! I solved the problem! really appreciate:) (by ssol)
September 2018 Pages: 123456... 9
  Archived months: [aug2018] [oct2018]

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