General C++ Programming - November 2009 (Page 3)

by kronos
Disabling javascript in Firefox with C++
 
Hi all I am writing an application allowing my client to send all the contacts/friends on a popular polish social network website the same private message. It'...
[no replies]
Pointer arithmetic
 
I have a confusion here..... "... the behaviour is undefined for arithmetic or comparisons with pointers that do not point to members of the same array. (Th...
[1 reply] : I think the standard is clear - your code is wrong. But I'm sure it wi... (by Abramus)
reverse () function
 
The following is the testing code for the standard C++ generic algorithm reverse() taken verbatim from a reference book.It compiles (w/o errors or warnings in D...
[4 replies] Last: Yes.....thank you kenshee I understood Bazzy. (by buffbill)
by ccoder
Object Oriented Number Guessing Game with Range
 
Hi could someone help me with my existing code !? I need Write an OBJECT-ORIENTED program using 2 Classes to create a guessing game in which the user must gue...
[1 reply] : no need just use a static bool or a just bool if your only running one... (by kenshee)
here do i go from here?
 
I've finished Beginning C++ by Michael Dawson, and i'm keen to further my C++ knowledge but i was wondering where do i go from here? without getting out of my d...
[4 replies] Last: Start with Thinking in C++ it is word heavy and long but well worth th... (by kenshee)
by netP
Big-O...
 
Hi, I am currently writing C++ for my class project. I realize that my codes run with 2*m*n^3 - n^3. I wonder can I said that Big-O of my algorithm is 2*m*...
[1 reply] : It's O(n^k), or polynomial. Big O notation only gives an approximate r... (by helios)
by mrkhtn
integer to user-defined type
 
Hi all, Got a problem I need to resolve. How I would I convert this Binary Search Tree to accept user-defined types instead of integers: Templates maybe? how...
[7 replies] Last: hey I debugged it, thanks for the help though bazzy (by mrkhtn)
need a smart pointer that can be customized
 
For I need wrap some of the c code into class in my work, I have to deal with a lot of user defined structure pointers which can't be freed by simple delete. I ...
[2 replies] Last: Look up boost::smart_ptr library. You can write your own custom alloc... (by jsmith)
by JRevor
About sets of sets (set< set < KEY> >)
 
Creating a set of sets of <X> is possible, since operator < is already overloaded within STL's set class. (So please don't write an example program showing me i...
[6 replies] Last: Thanks, PanGalactic, that was the answer I was looking for. (by JRevor)
by dkaip
problem with using variables as ofstream save locations
 
Hello all. Working on CodeBlocks, GCC, windows XP, the codes dosn't make file at realtime. Where is the problem? std::string s; s="asfil"; std::fstream(...
[2 replies] Last: Thank's a lot (by dkaip)
I HAVE PROBLEM WITH THIS
 
I HAVE BEEN THINKING WHAT IS WRONG WITH THIS PROBLEM FOR THE PAST TWO DAYS.. * */ //Header include statement #include <iostream> #include <iomanip> #inclu...
[7 replies] Last: Okay, you still have not said what your error is, but I think you need... (by closed account z05DSL3A)
Need feedback on an idea for a program
 
I decided to create a simple HTML analyzer. By this I mean that it will check that all tags are correctly opened and closed in order e.g. <i><b>hello</i></b> wo...
[6 replies] Last: The general answer seems to be to use a stack so I'll give that a go. ... (by mcleano)
by giro82
Getting variable value & error E2288
 
Dear Reader, I am writing a application in Builder v.6 using few Standard objects like Buttons and MainMenu. I have following problem. When in object ...
[1 reply] : The -> operator doesn't do what you seem to think. You can't get a ... (by Disch)
Get 1 byte from a 4 byte variable
 
I need to get the last byte (bits 24:31 inclusive) from an unsigned int variable into a char variable. I have a variable to store all 32 bits from ecx. Accordin...
[4 replies] Last: Like this: unsigned ecx; asm volatile( "cpuid\n\... (by chrisname)
Memory handling
 
Here is a contrived example that crashes, but i don't understand why. Can anyone please help?! main.cpp #include <vector.h> #include <iostream.h> #incl...
[5 replies] Last: That's what classes are really for, to break up the program into littl... (by kbw)
Anybody Try Solve This. ASAP!!
 
Type casting is common in writing programs. It converts from one data type to another, for example from integer to double or float. Write a complete C++ program...
[4 replies] Last: Cannot compile...... :-(( (by razi3105)
by CQ75
Linking error using a class list.
 
I recieved the error "1>List.obj : error LNK2019: unresolved external symbol "public: void __thiscall list::resetlist(void)" (?resetlist@list@@QAEXXZ) refere...
[5 replies] Last: Are you using Visual C++ 6.0? (by helios)
by mrkhtn
C++ pointers (1,2)
 
Hi all, trying to get my head round pointers in C++ but I'm not getting nowhere! Can anybody pull the following apart and explain each detail... void push(DT v...
[25 replies] Last: Helios: Hint: use a supporting data structure with a link list. th... (by writetonsharma)
template header issues
 
Hi, I'm trying to use a library that has some template classes, and thus I have some classes of my own now that inherit these templates. This means I end up ha...
[4 replies] Last: This is what your header should look like: #ifndef _CDRAWSEQUENC... (by Disch)
by Jerome
C++ forbids comparison between pointer and integer
 
Here's the code: struct resident{ . . string lastName; . . }; void LastNameCheck(resident ){ for(int i = 0; i < lastName.length(); i++) ...
[2 replies] Last: You are comparing a char (integer) with a const char* (a pointer):... (by Duthomhas)
November 2009 Pages: 12345... 16
  Archived months: [oct2009] [dec2009]

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