General C++ Programming - August 2009 (Page 5)

by Mac
binary to interger
 
Hi, I'am looking for the fastest way to convert the a binary number into decimal value, The binary number is a char array of 0 and 1. So far, i come up w...
[8 replies] Last: Don't use gets()...that is all... (by firedraco)
Ordering of LinkedList code..
 
Trying to figure out why my list() class pointers are being overwritten with the third node. What happens in the insert function (posted) is that the second tim...
[1 reply] : This will sound mean but stl will make this a non issue. Use std::str... (by bnolsen)
Bad Allocation Exception by filling a vector
 
Hey Guys, I am using MSVC++ and here I am using a vector as a container and I am storing 3d Points in it. The Points have a double for each coordinate. Wh...
[6 replies] Last: Your problem is memory fragmentation due to the way vector resizes its... (by jsmith)
by Null
Very strange goto
 
#include <conio.h> int main() { int i; goto *i; // yes, it compiles! And crashes... getch(); } anyone can explain what's goin on? I'm just cu...
[7 replies] Last: That sounds like a silly addition. Wouldn't assigning to a variable an... (by helios)
by Gregor
simple HTTP response
 
I'm writing a server that will send a simple text file with some info. I read the html 1.1 response section from specs here: http://www.rfc-editor.org/rfc/r...
[2 replies] Last: As I understand it, the second CRLF is only when returning additional ... (by Gregor)
use of class template requires template arguement
 
This my first post. This is the error C2955, it is in relation to how i defined my list in my template. namespace met { template <class T> class CState...
[no replies]
About the return address of shmat
 
Hi, My server always coredump when restarted without clearing shm. When gdb into it, I found that a pointor saved in shm pointed to a wrong memory. So I dou...
[1 reply] : You shouldn't put pointers in shared memory. Each process may map mem... (by kbw)
Embedding ASM
 
Hi. I was learning x86 (I love it) amd I know that you are able to embed it in C and Pascal. How can you do it in C++? Thanks.
[2 replies] Last: Thanks. The ASM is fun, I never realised it was so easy to learn. Imp... (by chrisname)
I/O Operations running into fatal runtime error
 
Okay, so I'm attempting to write a rudimentary program to add new tags to XML files and their respective Schemas. I'm using Dev C++ v7/0.2 to compile and set up...
[8 replies] Last: Even with your advised changes, the program still isn't writing. Here'... (by Gooblah)
by OSU123
Inventory Class Implementation
 
Ok: I am using polymorphism and inheritance to create an inventory tracking program. My issue is that I don't understand how to read a user input into a class. ...
[2 replies] Last: The standard answer, I think, would be to do it outside the classes. ... (by webJose)
how to write the program
 
Write a program to find the sum of series: 1+ x 1 /2! + X 2 /3!+ ……+X n /(n+1)! ,where n is any number inputted by the user. ...
[8 replies] Last: Thank you so much johnkravetzki (77). i appreciate your help. thanx ... (by Zishanrbp)
Static Attribute in Class
 
class xyz { public: static int abc; }obj1,obj2; Are static attributes allowed in a Class? How can this work? As far as I know, only when we inst...
[2 replies] Last: Thanks! (by luckycusp)
container iterator without end
 
Hi Guys, I am looking for a container with a specific iterator. When I am iterating over all elements and reach the end, it should start from the beginning a...
[2 replies] Last: Thank you for your help :-) (by blueshark)
recursion maze
 
This is a recursion maze which the starting object would move in four direction orderly: #include <iostream> #include <conio.h> #include <iomanip> #defin...
[no replies]
Access Violation, Why?
 
Its the same! Just a different location in memory... //main.cpp wineries->insert(winery("Lopez Island Vinyard", "San Juan Islands", 7, 95)); Then ...
[8 replies] Last: Yes. I thought I could pull that off in the c'tors init list. ... (by lampshade)
by Null
Anyone used set_new_handler?
 
http://www.cplusplus.com/reference/std/new/set_new_handler/ I found this useful but i haven't seen this function used by anyone on this site. Or this is some k...
[1 reply] : It's not evil. If you need it, use it; if you don't, don't. (by kbw)
Read line by line
 
Is there any way to read line by line from a file with the WIN32 function ReadFile()? Or at least a work-around...
[4 replies] Last: Are you suggesting something like: DWORD dwChars; LPSTR lpChar ; ... (by LoLFactor)
Weird class declaration.
 
NVM, dumb me.
[no replies]
How to display time elapsed continuously while a lengthy task is running?
 
On Linux I run a C++ program that invokes 3 tasks one by one like this: int main() { task1(); task2(); task3(); return 0; } Each task ma...
[12 replies] Last: Thanks. I'll download the code and try to figure it out. (by bjch512)
string literals split across lines
 
Is this legal in standard C++? cout << "hello" "world" << endl; I've always assumed a stream insertion operator was required between the string literals....
[1 reply] : It's a kind of string concatenation that happens at compile-time. If y... (by helios)
August 2009 Pages: 1... 34567... 12
  Archived months: [jul2009] [sep2009]

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