General C++ Programming - April 2014 (Page 20)

How to write boost unit test in c++ in Visual Studio 2010
 
Hi All, I'm new to c++ and boost library also. I need to test a function of my library. For example // Functions.hpp int add(const int x, const int y); ...
[1 reply] : any help will be really helpful.. (by geeksia1)
Problem with Sorting a sorted array
 
Hi ,The problem with my code is Highlighted with Bold , I want to sort inside that else if , But after i choose the option in the introduction , the output wind...
[no replies]
problem with cin and getline
 
So I have my programs where im trying to use both cin and getline, I know this will bring problems with the >>() but I dontknow how to fix it or make it work. ...
[1 reply] : See: http://www.cplusplus.com/forum/general/69685/#msg372532 (by JLBorges)
Reading from a file with characters and numbers
 
I may be over thinking this. I need to open a file that has multiple lines that look something like this, " black box 100.01 33.5 78.93". What this shows is the...
[3 replies] Last: I forgot to mention that I'm in an introductory c++ class. So I do not... (by nevetS246)
Running Multiple Projects in C++ Solution Explorer
 
Hi guys and gals, Is there a way to have multiple projects I can store in solution explorer? If it is not in solution explorer which would it be under the view...
[no replies]
Help
 
Hello Looking for some help to solve a problem I can't figure out. For example I'm given a command ('D') to remove a player (Lastname: Green, Firstname: Tommy) ...
[no replies]
function output 2
 
Would myint be 40 and my float be 4.8? Come up with anything different? Consider the function definition void Demo( int& intVal, flo...
[1 reply] : Hi, Why don't you compile it and find out for yourself? Should only ... (by TheIdeasMan)
Adding two arrays, beginner program!
 
// The program below should add two matrices using function. // I have problem in the third function (the summing function) // It's saying that something wro...
[2 replies] Last: Thanks for your help, but I'm sorry I can't clearly understand your re... (by aslan10)
Function output
 
The output I got was 1, 14, 9 Anybody get a different answer from this problem? Given the function definition void Twist( int a, int&...
[2 replies] Last: Keep in mind that Twist(t, s); doesn't change the value of t , sinc... (by long double main)
How do I ouput strings based on input when branching with if
 
How do I output strings when branching with if ? For example with numbers you can do this int num = 1 cout <<" please type a number 1-2" << endl ; ...
[2 replies] Last: Thanks very much LB, I really appreciate the help and fast response... (by Cbasic88)
int to fixed size char array
 
Hello, I'm writting program and need to convert int ot char array without \0 simbol. I have tryed snprintf , but his returns array full of \0 simbols if it is ...
[2 replies] Last: I got it. Thank you (by gedinskas)
how can i cin.ignore() only a selected variable?
 
how can i stop a loop if continue == 'n' || coninue == 'N' i need to keep my continue character but cin.ignore my Number integer . ...
[4 replies] Last: The ignore should occur after line 43. The condition on line 46 is no... (by cire)
Error when comparing special charracters like "č"
 
Hello, how can I compare strings, so the function will return special characters, such as "č" to be between "c" and "d" ? I tried to use strcmp and _mbsncm...
[8 replies] Last: great! thanks, works like a charm now (by mekkatorqu)
by bara1
working with Excel file in C++
 
I have an excel file (.csv) like that: Student ID | Average mark 1 | 8 2 | 6 3 | 9 Now input the Student ID at command wi...
[no replies]
Dynamic memory allocation in a class
 
Hello, I'm having problems with this code: #include <iostream> using namespace std; class Foo { public: Foo( int n ); // Constructor ~Foo...
[2 replies] Last: There is a rule known as the "rule of 3". It says that if you need to... (by Disch)
How to redeffine operator ->
 
How i have to redefine the operator -> on my own class? Thanks in advance
[4 replies] Last: Yes sure, copy & paste error x.. Anyway Thank you! (by Franconet)
by birbal
How to assign char array as user define string object
 
STRING s1 = “FOOBAR” Here STRING is a user defined class. how to assign a constant char array "FOOBAR" to string object? Copy constructor need to be same...
[2 replies] Last: SomeType SomeName = SomeExpression; //initialization -> constructor c... (by LB)
Writing a derived class from a given base class
 
C++ Programming Topic Using the following Counter class as your Base class, explain (and show) how inheritance works by deriving a BetterCounter class from ...
[3 replies] Last: Step 1. Give up our time to do people's homework for free. Step 2. ? ... (by MikeyBoy)
about delete keyword
 
Hello , I just wonder how I can delete a parameter in a function . As below ; int *buildTrail(int antIndex, int start, double *pheromones) { int *trail ...
[4 replies] Last: std::vector<int> buildTrail(int antIndex, int start, double *pheromon... (by ne555)
Converting string to integer array in C++
 
For Example, it the entered string is: 0324152397 I want it to get stored in an array like- ... . Secondly the string entered may be of any length that is...
[2 replies] Last: #include <iostream> #include <string> #include <vector> using names... (by Duthomhas)
April 2014 Pages: 1... 1819202122... 41
  Archived months: [mar2014] [may2014]

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