General C++ Programming - May 2018 (Page 9)

Why is the program giving me odd characters after Chinese characters?
 
Here's the problem, the program is used to reverse text while I am learning C++, and that is an exercise. It worked nicely through English characters. Then I st...
[7 replies] Last: Do the non-reversed Chinese characters appear correctly? (by Peter87)
by sonkun
Reducing the complexity of an algorithm
 
Greetings everyone. I have this algortihm: int x ,n,j,k,i; int maxi=0; for (i=1; i<n; i++) for (j=i+1; j<=n; j++) { bool ok=true; for (k=i+1; k<...
[3 replies] Last: There is a much better algorithm, N log N : https://www.geeksforgeeks.... (by tpb)
Sets and Maps, function wont compile.
 
Hello, I have to write code to create this function. /* set<Book> publishedBefore(int year); returns a set of Books that were published before a given year. ...
[2 replies] Last: Thank you Repeater, I was able to complete my assignment. Cheers (by agelakute)
dissecting a hamster(yes a coding question)
 
sorry I just tried to throw a little humour in the title, anyway I would love if someone could help dissect the hamster program used mainly on Kali linux, ...
[1 reply] : he tests for if (m_string) but m_string is not a boolean variable so ... (by tpb)
by stav
Changing project structures and incldues problem?
 
This isn't actually a problem im having it is just something i've been wondering about for a while. say i have a big project with a lot of headers and source f...
[1 reply] : As long as a) there are no duplicate files in the project, and b) you ... (by helios)
vector subscript out of range
 
My code is building but every time I try to run it I get an error message telling me that the debug assertion has failed on line 1795 and the expression is: vec...
[6 replies] Last: That was the problem. Thank you! (by rajekdelta)
C++ code access violation writing location during debugging
 
Hello fellow C/C++ programmers I have some code that I am currently debugging on VS2015 windows 8. When the arrow of the local windows debugger gets to the l...
[1 reply] : Your code seems to have the very same problem as this program: /* ... (by keskiverto)
Binary Search
 
I am attempting to implement this binary search but it returns 11 and says 12 cannot be found. int binSearch(const vector<int>& sorted, const int target) {...
[4 replies] Last: I am an idiot. i need to be checking the location. not the value. Than... (by d1g1talarts)
Expected Primary Expression Error | Assignment of Double Function
 
I am working on this problem for a class, and I am running into a lot of errors. I spent a good deal of time trying to troubleshoot/de-bug my code, but have bee...
[3 replies] Last: Thank you guys so much! I also had a different error in my original co... (by coloure)
by Mathes
SFINEA and implicit type conversion
 
Hi, lately I started to dig deeper into templates and SFINEA. In my project I was able to use SFINEA to do basically what I want. But there is one except...
[2 replies] Last: Hi Peter, you are absolutely right, it should be declval<T> instead... (by Mathes)
by ED201
can somebody help with programing arduino due
 
I have this code which samples analog input 1Msps and I want to put the data into declared array instead of sending to serial port int myArray ; here is t...
[2 replies] Last: this is what I though I would do something like writing to array I ca... (by ED201)
Help me, I'm not good at this stuff
 
Help, I'm fairly new to C++ and really having trouble understanding the whole thing. For this program I'm supposed to design and implement a C++ class to store ...
[6 replies] Last: You're welcome - hope it helped! (by MikeyBoy)
Manual bomb placement in minesweeper
 
Hi guys, I'm doing a bit of learning and I have been trying to figure out how to set bomb placements manually for test purposes, could someone please assist? th...
[2 replies] Last: Sorry, I'm quite the noob, could you put that into my code? I can't ev... (by sfxhewitt)
Merge sort with Vectors
 
I am trying to implement a merge sort and the end result that i am getting is not quite sorted correctly. Anyone able to explain to me why? vector<int> mer...
[8 replies] Last: output spits out 1 7 12 15 13 9 11 10 5 8 14 6 3 4 2 You did not sh... (by keskiverto)
Help with this game!
 
Hey everyone. I am re-writing the Oh n0 game, developed by Martin Kool in C++. If you are unfamiliar with how the game works, check it out: http://0hn0.com/ ...
[17 replies] Last: Hello, @alex067. The line counts the number of adjacent cells (e.g. ... (by lastchance)
Splitting Strings into String arrays
 
How can we spit strings into arrays / vectors in c++ without any external libraries, such as boosts? string temp = “Well//Hello//There//Everyone”; stri...
[3 replies] Last: Yes, it could be written with getline like this: vector<string> spli... (by tpb)
Guidance needed urgently...!
 
Please help me to get the following output in C++ *********** * * * * * * * * * *********** I have drawn the outer box b...
[no replies]
by Luthor
help: list<struct> of list<string>
 
Trying to create a list that contains multiple keys with multiple content for each key. Do not want to use multimap because it would double the size of the file...
[9 replies] Last: Since memory is an issue, consider using forward_list instead of list.... (by dhayden)
why reinterpret_cast works while memcpy() not
 
I have a char array char* array which contains 3 float variables (in binary) and I want to extract it into a struct: struct float3 { float data1; flo...
[3 replies] Last: Sorry, I added wrong topic name, the correct is: why memcpy() works wh... (by warchief)
by ahaana
getting error: invalid conversion from 'TTcell (*)[30][30]' to 'int' [-fpermissive] int insertdata (cl)
 
#include <iostream> #include<string> using namespace std; struct TTcell { string days = { "Mon", "Tue", "Wed", "Thur", "Fri" }; string Subject ;...
[4 replies] Last: Lets have a function declaration: int foo( bar ); What is the 'foo'?... (by keskiverto)
May 2018 Pages: 1... 7891011
  Archived months: [apr2018] [jun2018]

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