General C++ Programming - February 2013 (Page 38)

problem with files in C++
 
hi, i created 2 text documents on my Desktop and wrote in them then i want to open these to files from c++.I wrote this program but every time i run it i get (-...
[5 replies] Last: thanks guys for the help i really appreciate it . i have solved the pr... (by pgstudent)
Copy Constructor
 
.h file template <class T> struct ListItem { T value; ListItem<T> *next; ListItem<T> *prev; ListItem(T theVal) { this-...
[10 replies] Last: Thank You All of You, I found my mistake (by Farrukh12)
socket programming error
 
Hi everyone, I got errors when I compiled my server and client program. This is my server program. I am also using ubuntu 11.10. #include <netdb.h> #inclu...
[3 replies] Last: Instead of this, serverADDRESS.sin_addr.s_addr = inet_addr("172.17.11... (by HiteshVaghani1)
by hvigil
String Problem error
 
Hey guys, I was wondering if you could help me out with this problem on my program. I ask the user to guess a letter. If the letter is not found in the string ,...
[8 replies] Last: Gonna break this down for you and show you exactly what is going on in... (by Smac89)
Sort the data saved using shell algorithm. But it won't work in my case
 
#include <iostream> using namespace std; class CD { public: static const int num = 100; char publisher , title , location ; int year; public: void virtual...
[1 reply] : If I implement the sort algorithm in a more simple program it works ju... (by closed account E607ko23)
by hoity
How to take multiple line string in c++?
 
I want to take multiple line string in c++. How can I take this. Such as I want to take this as input: HELLO MY LOVE, I M HAPPY BECAUSE SOON I WILL BE TO...
[2 replies] Last: std::string Para = " "; while(std::istream::getline(std::cin, Para))... (by hoity)
permission denied error in socket programming in c
 
Hi everyone,I got error when I run this program. I am using ubuntu 11.10. This is my program. #include "socket.h" using namespace Robot; //int ...
[no replies]
How to output an array of strings?
 
This is sort of a dumb question but, how do you use a for loop to iterate through strings to display them in a console?
[3 replies] Last: for(int w = 0; w< (int)index.length(); w++){ for(int t = 0; t < (i... (by Smac89)
by hvigil
string class char finder.
 
Does anybody know of a string class that finds a char in the string ?
[1 reply] : Hope, following link may be useful to you.. http://www.cplusplus.com/r... (by HiteshVaghani1)
by Smac89
ExceptionAbort trap: 6
 
This is my first time using vector type. When I run this code, it gives me an exception. Can some one tell me what is wrong with it? #include <cstdio> #inc...
[8 replies] Last: Not bad cire, I'm gonna have to look into that when I get home. (by Smac89)
which is better - 3 ways to add an entry to map
 
I have the following code in sourceFile.cpp. functionA() is first called and inserted entires for key1, key2 and key3. Then functionB() gets called to use the v...
[2 replies] Last: Thanks, Cubbi. You provided a very nice solution. I'd like to give mor... (by Ben Smith Jr)
Error Help.
 
Here's the instructions: Write a program that asks for the user's height, weight, and age and then computers the clothing sizes according to the formulas: -Hat...
[1 reply] : double jacketsize(double weight, double height, int age) { if(age<40)... (by Smac89)
lvalue required as left operand of assignment
 
Hi everyone, I got above error in my program. My program is socket program. I am using ubuntu 11.10. #include <netdb.h> #include <netinet/in.h> #include <...
[4 replies] Last: hi the error is like that server4.cpp: In function ‘int main(int, c... (by sanda199)
Formatting strings in C
 
I'm trying to write a short program that takes the input from a user and trims any leading/trailing white space, and then checks how many words are in the strin...
[3 replies] Last: Can I just say that checking if the integer value of a character is la... (by Veltas)
Recursion Resources + Help
 
I get the feeling that recursion is a lost art in programming. Most everything that can be done recursively can be done iteratively -- However, it's arguable...
[1 reply] : How is recursion a "lost art"? It's just a technique that people use ... (by Veltas)
search array of strings
 
the function should search the array of strings to find how many times the word 'the' was used. but its only returning a 0. int FindThe (int The, char Parag...
[5 replies] Last: thank you! this works (by sean shine)
by Cubbi
Boost 1.53
 
Finally boost.multiprecision and boost.lockfree! http://www.boost.org/users/history/version_1_53_0.html
[no replies]
My program stop working after a bit and i dont know why
 
I dont know why my program stops work, im trying to make it a game but so far its failing Im using Dev C++ 4.9.9.2 and i saved it has ".c" at the end This is ...
[2 replies] Last: I get no errors and the goto isnt ignoring the scanf since i can input... (by HunterXZ)
by Dannie
Need Help Converting Pseudocode to C++ to find Branch-and-Bound for the Early/Tardy Problem with a Common Due-Date
 
// main() function. // It initiates the search for the optimal solution. main() // Create the root node. create(root_node) root_node.Type := LEAF root_no...
[no replies]
iostream+sstream
 
Hi, If I include <iostream> first and then <sstream> all std::cout become undefined. When I reverse the order of includes it gets resolved. Why? Daniel
[3 replies] Last: Thanks MiiNiPaa and jaded7. I'm using VS2012. I suspect too that it i... (by bendaten)
February 2013 Pages: 1... 3637383940... 43
  Archived months: [jan2013] [mar2013]

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