General C++ Programming - March 2009 (Page 7)

by quant
c: structs func and pointers
 
hi all, I've a truble with slimilar of this code.. struct first *fir; struct second *sec; func(struct firs *fi, struct s *se){ ...... return func(fi,se);...
[11 replies] Last: Curiously enough, that's exactly what I said in my first post. In ... (by quant)
I want to know how to split sources and header files
 
Hello. I'm a programmer in Korea. I knew this site few days ago and I learned something. Thank you~ I always confused to split header file and include th...
[6 replies] Last: Ok. I see. :D Thank you everybody. ^_______^ (by higasijoe)
How to implement some find and replace function
 
I've spending some on my time on this issue but unfortunately I couldn't completed what I'm trying to achieve. My objective is to implement this kind of func...
[4 replies] Last: STL find replace algo is not the best so you can implement KMP algo wh... (by writetonsharma)
Converting raw data to a structure
 
Using a packet sniffer that I wrote, let's say it gives the data "4A 2B 00 00 00 00 41 3A 00 00 49 6A 00 00 03 2A 4A 09 35 2A" I can convert that data into the ...
[4 replies] Last: looking at the code i wrote previously.. long l ={0x6A,0x49,0x... (by writetonsharma)
by Gregor
vector of function pointers problem
 
Hello. Here's the problem typedef bool (*eventcallback)(Window*, INTERFACE*, unsigned, long); bool deflistener(Window* wnd, INTERFACE* inter, unsign...
[7 replies] Last: hmm.. great.. :) (by writetonsharma)
What is the minimum knowledge required for a job?
 
Hi. I was wondering, what (in general), is required to get a job in programming. If I know C++ only, but know it very well (which, at this point, I cannot say...
[5 replies] Last: If you look at most of the job postings out there for programmers, the... (by Return 0)
Error in xmemory?
 
I'm writing a program that I have recently made some moderate additions to. However, on compiling I now get the following error: "c:\program files\microsoft...
[no replies]
zip files?
 
Is there a way to insert a zip files into this we site post? If so, please advice me how to do it. greg022549
[1 reply] : Technically, yes; but please don't. (I won't tell how.) Place your Z... (by Duthomhas)
the problem with building an C++ project
 
Hi all, I have been always using MS VC++6.0 in programming, but now I encounter some strange source code of a project in which all the C++ files are named w...
[1 reply] : Please let me recommend that you go to microsoft and upload the new ve... (by greg022549)
ofstream object failing to open file
 
All I'm doing is creating an ofstream object called outFile and then opening a text file and writing to it. For some reason it fails, however the program opens...
[5 replies] Last: I already fixed the issue...I just forgot to tell the program to make ... (by aeronet)
Copying design issue
 
Ok, so I pretty much have something like this (obviously significantly simplified): class VirtualBase { virtual void myMethod() = 0; }; class VirtualBase...
[11 replies] Last: rossman: I believe you need the clone pattern which is totally vali... (by jsmith)
by R0mai
Default parameter : std::map
 
#include <string> #include <map> class MyClass { private: std::map<std::string, std::string> map_; public: MyClass( const std::map<std::string, std...
[10 replies] Last: you talking about a bug in gcc... :D hehehe.. anyway.. class MyCla... (by writetonsharma)
function template parameter
 
Why are the parameters references? template <typename T> void swap (T& t1, T& t2) { T temp; temp = t1; t1 = t2; t2 = temp; }
[4 replies] Last: Cool. Thanks. (by VictorH)
by dooper
Correct my code
 
#include <iostream> #include <string> using namespace std; string responce; int main () { int array = { { 0, 95, 173, 103 }, { 95, ...
[5 replies] Last: You cannot accept a string with spaces using cin !! It will just take... (by luckycusp)
pass by value or reference?
 
Can any one tell me why the following code output 10 instead of 12: #include <iostream> using namespace std; void afunction(int *x) { x=new int; *x...
[2 replies] Last: If you wish to use afunction() to change the value of v in main(), you... (by DirkMaas)
Recursive function as #define statement
 
Why does this work: int factorial(int n){ return(n==0 ? 1 : n * factorial(n-1)); } but not this: #define factorial(n) n==0 ? 1 : n * factorial(...
[3 replies] Last: An explanation of what you're trying to do should make it clear why it... (by jRaskell)
by ark217
Trying to figure out how to write this function...
 
I think it would have to be made a recursive or at least some kind of iterative function. -You have a list of hypothetical tasks, each one ("i") with a given...
[1 reply] : You have to understand the problem before you can design a solution. ... (by jsmith)
\0 and string - C++
 
string msg = "33.44.55.66"; cout<<msg<<endl; msg.insert(6, "\0"); cout<<msg<<endl; The output of both shows as 33.44.55.66! The second one should break ...
[4 replies] Last: Null characters were needed in C because if you did something like c... (by rossman231)
Code::Blocks don't recognize clrscr()
 
hi everyone ..... I'm using Code::Blocks v8.02 ......... when I try to clear the screen using the function clrscr() ... it tells me "`clrscr' was not declar...
[5 replies] Last: thanks for the info (by vbnetskywalker)
getter not displaying properly in pgm.
 
This is my first day on this web site and I would be happy to submit this as a .zip file if some one can explain to me how to do that. I have a problem. I ...
[no replies]
March 2009 Pages: 1... 56789... 21
  Archived months: [feb2009] [apr2009]

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