General C++ Programming - November 2016 (Page 22)

A progressive disclosure implementation in C++
 
Hi, I have been trying to implement the "Progressive Disclosure" pattern for a small testing API with success. The wanted behaviour was to have the "plusFo...
[10 replies] Last: Indeed! I thought about this problem and I think I fixed it. You can h... (by BobMorane)
How to see all elements of array created using pointer during debug time
 
When debugging a program it is possible to see the values of everything in the program, especially the local variables of the function where we have entered bre...
[3 replies] Last: > what is gdb? The GNU debugger. As far as C++ is concerned, the poor... (by JLBorges)
Compiler errors when playing with members versus references. [Boost asio]
 
Consider this code which works perfectly. It opens a socket and sends a message to an IP and port: #include <boost/asio.hpp> struct Client { boost::asio...
[2 replies] Last: Wow, it's the simple mistakes that really get you! Thanks. (by Stewbond)
how to convert into C++ matlab
 
I have this binary data (data.dat) with 320MB, in this data contains 32e7 line of hex number, such as: 1312cf60 d9 ff e0 ff 05 00 f0 ff 22 00 2f 00 fe ff 33...
[1 reply] : You cannot read a vector this way. In mathlab it looks like it reads a... (by coder777)
Reading an array backwards & printing!
 
Hey guys! I'm having a user input a vector and blah blah. Any who, I need to know how to use the member function vest.reverse(); in order to read the v...
[13 replies] Last: Thank you sooooooo much!!!! I've been trying to figure this out for ho... (by closed account ENhkSL3A)
by Jeswin
Indian Computing Olympiad problem implementation
 
This is the link to the problem : http://opc.iarcs.org.in/index.php/problems/WORDLIST This is what I coded, but unfortunately I'm getting a runtime error eve...
[1 reply] : There are several things that needs to be done to clean up given raw t... (by gunnerfunner)
Trouble with returning a value.
 
Hey so i have a code here that only will return the value that is desired within the fuction but when it gets returned to the main function it displays somethin...
[no replies]
i need help finding max, total and average
 
i tried for loop and if statements but just cant figure it out how to do it, if someone can give me some tips and direction. please thanks. i need to find max,...
[8 replies] Last: Cant thank you enough bro, due tonight and finally im done. Thanks alo... (by waqarmalek)
Forward declaring class
 
Hi, Can you tell why forward declaring the class not work in below code? Compiler gives error 'B::a' uses undefined class 'A' #include <iostream> class A; ...
[3 replies] Last: You could read: https://herbsutter.com/gotw/_100/ https://herbsutter.c... (by keskiverto)
Error: Expression is not assignable C++ struct
 
I am writing a normal bandwidth kernel in C++ for FPGA, which is reading something from host memory and writing it back to different location in host. I'm using...
[6 replies] Last: (byte *)din_mem + CA_INPUT.address + i*64 or (uintptr_t)din_mem +... (by helios)
by Xnot
Printf prints too much
 
Hey together, I want to print Frame_ID which is a char array of length 16 in a struct t: char Frame_ID[2*8]; now I want to print it with: prin...
[3 replies] Last: isnt it automatically finished by a null character No. do I have ... (by cire)
Iterative C++ Solution to Towers of Hanoi
 
//Iterative Solution to Towers of Hanoi #include <iostream> #include <cmath> #include <iomanip> #include <stdio.h> using namespace std; bool checkEv...
[no replies]
by bozmin
comparing two objects
 
I couldn't find where is the problem in this comparison. It always display on MAC : Segmentation fault : 11 The two objects contains strings(words) picked up ...
[1 reply] : The operator == function is calling itself recursively until the stack... (by Chervil)
2D Array only storing final row information.
 
Goal: The aim of this code is to read in a .BMP, check each pixel, if black record 0, if not record 1 into a 2D Array. Problem: After assigning values into...
[2 replies] Last: An example of how the code wasn't working as I was expecting: Direct o... (by mullen1)
Memory deleting problem
 
Here is my Object code: class Object { private: std::string name; sf::Drawable* drawable; //from SFML library sf::Transformable* transformable; //...
[2 replies] Last: I agree with Coder777, who suggested that you should keep smart pointe... (by mbozzi)
Initialization help- c programming
 
Declare an array named taxRates of 5 elements of type double and initialize the elements (starting with the first) to the values 0.10, 0.15, 0.21, 0.28, 0.31, r...
[1 reply] : Partially correct, partially not. The or are in the wrong plac... (by Chervil)
does access to vector elements scale with vector size
 
Hi all. First I would like to thank all the forum members for the insightful posts that have helped me tremendously with c++. I have been self studying and u...
[4 replies] Last: I found the problem. I had called the wrong function in the .spC() ... (by howardjason)
Random number generatior
 
the following program I wrote to print the random number between 0 and 100. it is returning me the sane number 20 times. I want it to print different numbers. C...
[1 reply] : You initialize the random generator each time with the same value, the... (by Thomas1965)
SFML didn't work
 
hello everyone I wanted to link SFML(2.3.2) files with my visual c++ 2010 express I took a version of SFML that is compatable with my compiler and followed ...
[1 reply] : Sounds like the linker can't find the SFML .lib files. Are you sure th... (by Thomas1965)
SOS
 
If you know how to write a function, I'd write a function for each of the things your asked to do. read each line, pass it to each function then go to the next...
[no replies]
November 2016 Pages: 1... 20212223
  Archived months: [oct2016] [dec2016]

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