General C++ Programming - May 2011 (Page 7)

by juvan
printf() bug? or..?
 
Hello could someone please explain this odd behavior of printf() funtion: printf("=%u =%u\n", 11111111111, 11111111111); // Output: =2521176519 =2 T...
[5 replies] Last: If your compiler checked the printf arguments, you have a chance of ca... (by kbw)
Help - converting void* to string&
 
Hi, I have 3 functions that receive different types of parameters, but at some point preform the same actions.. seek(int key) seek(char* key) seek(string& key...
[3 replies] Last: You could use a templated function/class, and depending on what you ar... (by webJose)
Inserting numbers into a created class array
 
I am making a program that will allow me to randomly generate coordinates for the locations of "Gravitars". I havent even implemented the Get or Set functions o...
[2 replies] Last: Thanks! (by closed account zbREy60M)
template and map problem
 
Hi there, I am trying to develop a function template as follows: template <typename Iter> typename Iter::value_type findMost(Iter begin, Iter last) { ...
[no replies]
Library of Classes (1,2,3,4,5,6,7)
 
What should we work with first temperature, distance, time, etc.?
[126 replies] Last: Unlucky about that :/ I would offer to help but I'd probably only get ... (by anonymous23323124)
Putting data into an array
 
Hello, I'm trying to write a program that generates a series of random coordinates. Right now, I've only gotten to the part where I am generating one random n...
[2 replies] Last: This is similar to how I had it before, in which it worked fine and if... (by closed account zbREy60M)
by aatwo
Passing pointer to 2D array to function
 
Hey guys. I am stuck trying to pass a pointer to a 2D array to a function. How is this done semantically? Thanks in advance.
[6 replies] Last: :D Thanks for the article it was nice and informative. I might try tha... (by aatwo)
Where is my error?
 
#include <windows.h> int main(){ HMODULE hInstDll=LoadLibrary("C:\\WindowsHook.dll"); GetProcAddress(HMODULE hModule,LPCSTR lpProcName); void (*p...
[2 replies] Last: I found in here:http://msdn.microsoft.com/en-us/library/ms683212%28v=v... (by Helegurbann)
STL Vector problem (Segmentation Fault)
 
Hi everyone, I'm writing a game. There's a sprite class which contains vector of animation class. The problem is when I load the animation from files and assign...
[10 replies] Last: I removed old MingW and got new. And here's what I found In "new_alloc... (by Pravesh Koirala)
How Can I call C# method from C++?
 
I have a requirement where I will need to acces/call one of the method in C# DLL/EXE , please let me know how can I achieve this?
[1 reply] : http://www.google.com/search?q=call+c%23+from+c%2B%2B (by helios)
Urgent !!
 
#include <iostream> using namespace std; int validity(string ,string ); class item { public: string name; int cost; int sku; ...
[1 reply] : this is my code i when i execute the program and select the items for ... (by raptor85)
by Ronen
Get Lines From User straight into a file (without using temporary variables)
 
Hi guys , When dealing with files,how can I get a line from the user , and put it in a file ? (I mean that after the user has pressed "ENTER" , put the entire...
[no replies]
Help required to load a text file into a vector matrix
 
Hi, I need your help to design a program which can read text file and store in a vector matrix of integer type. text file contains data like this 0 10 ...
[5 replies] Last: Thanks all it works (by amanyasin)
help with "love" program
 
Hi, I'm trying to write a program that reads in a line of text and replaces each 4-letter word with the word "love". If the 4-letter word begins with a capital ...
[2 replies] Last: Hello I spent some time with your code and modified a few things Check... (by Pravesh Koirala)
code with arrays
 
I am compiling a code using code::blocks on Windows XP and I am getting this message: Compiling: C:\Dev-Cpp\first-part.cpp Linking console executable: C:\De...
[7 replies] Last: It's working now..thank you all. (by sanehatter)
overloading assignment operator
 
template<class TYPE_NAME> Array<TYPE_NAME> &Array<TYPE_NAME>::operator=( Array &rhs ) { if (this == &rhs) return *this; delete this; this->rhs; ...
[2 replies] Last: Got it working. Thanks. (by asdfkid)
Program Ideas
 
I need more advanced program ideas. Thanks.
[10 replies] Last: @Grey Wolf, I think OP just want to know ideas rather than working on... (by writetonsharma)
How else could I implement this?
 
I'm trying to design a search function for my linked list class called find(). So far, if the list's size is less than or equal to 50, it uses a simple sequenti...
[8 replies] Last: It's the starting position for the search, which is the middle eleme... (by writetonsharma)
Noob question: Reset Struct Variables
 
Hello, I would like to reset all of the variables within a struct object. So for example: struct LotsaFloats { float a, b, c, d, e, f, g } Assignment1,...
[9 replies] Last: There is no need to do "Assignment1 = LotsaFloats(); " The moment the... (by pkbhavnani)
fill manipulator in c++
 
The fill manipulator once set, now to unset it...? #include <iostream> #include <iomanip> using namespace std; int main () { double i=1.23456789; ...
[1 reply] : I think the fill is not something you deactivate. I think you just se... (by webJose)
May 2011 Pages: 1... 56789... 32
  Archived months: [apr2011] [jun2011]

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