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

sprintf Vs strcpy Vs strcat
 
Hi Guys, Can someone please explain me how sprintf is different from strcat or strcpy? Actually, I wrote one simple program #include<stdio.h> #include...
[3 replies] Last: Thanks a lot for the reply kbw and guestgulkan. It cleared up my doubt... (by kevinchkin)
what is wron in the program
 
I have a structure that have, Employee { char Last_name ; float Hours ; float H_rate; double Gross_pay;//pay for the week OK I...
[1 reply] : Your initialize() function is taking its parameter by value, which mea... (by jsmith)
by Jacko
const_cast issue
 
This program, compiled in Xcode (gcc 4.0): #include <iostream> using namespace std; int main() { const int i = 10; int *iP; iP = const_cast<int...
[14 replies] Last: To your first question: the programmer is at fault, because the const_... (by jsmith)
by varsha
replace a partucula string in C files
 
hi i am trying to search and replace a particular string in my program.. #include <stdio.h> #include <string.h> main() { FILE *fp; char name ; char...
[1 reply] : Please use the code formatting tags when posting code. strcmp compa... (by kbw)
by reven
class variable problem
 
hi there, i am an embedded software programmer. i use c language for my programs but due to a need i have to write a program for a divice in c++. the probl...
[5 replies] Last: That doesn't guarantee that a register will be used or which register ... (by kbw)
by ewanko
C++ primitive operations
 
Hello! i am a college student of Computer engineering. I would like to ask for an example of a primitive operation that has an implicit argument and side effect...
[1 reply] : I think you'll have to define the term "primitive operation". With my ... (by helios)
Error on const function
 
Hi.It's my first post in that forum so i hope not to post in wrong thread.Whatever.I have a project for my school and i have the following error on my code.The ...
[4 replies] Last: You mean to do something like rc = this->sfh.GetPage(currentPageID,mph... (by santaris)
by Deimos
Resource management with std::map?
 
Hello, everyone. I'm currently building a simple image manager which works with std::map internaly. It's supposed to work similarly to a repository: Images a...
[3 replies] Last: Thanks, helios and kbw! I think I'll go with dynamic memory allocatio... (by Deimos)
by kostka
Does using const ever speed up code in practice?
 
I understand that the const modifier allows the compiler more freedom when reading the associated variable versus the non-const version. I also understand that...
[6 replies] Last: If the body of the function is available to the compiler at the call s... (by jsmith)
Buying a C book but for c++ purposes
 
I was thinking of buying this book: TCP/IP Sockets in C: Practical Guide for Programmers (Morgan Kaufmann Practical Guides) http://www.amazon.co.uk/gp/produc...
[1 reply] : I'd recomend books by Douglas Comer and/or Richard Stevens. Try Inte... (by kbw)
stl map - could any one explain the o/p
 
class tst { public: tst() { cout<<"ctor tst()\n"; } tst(const tst& ob) { cout<<"cp ctor tst()\n"; } ...
[6 replies] Last: Thanks (by johnbach)
storing a variable which is an integer multiplied by a string
 
Hi i want to store 5x in a variable a(a=5x), where 5 is an integer and x is a single character string constant.what data type does a belong to?.below is the cod...
[5 replies] Last: It depends on how complex you want to get. Are you only going to supp... (by jsmith)
by peha
get in put from user as a date
 
hi all pros ;) here is my code int m,d,y; while(!CheckDate(m,d,y)){ cin>>m; cout<<"/"; cin>>d; cout<<"/"; cin>>y; } my problem is when us...
[7 replies] Last: Ah, that's a good point. Nevermind. Glad that worked, Peha. (by chrisname)
Quick Question
 
Is there a function that randomly shuffles up an array? Say I make a char array with the alphabet in it, and I want it to randomly print Letters from the char ...
[7 replies] Last: You mean std::random_shuffle( alphabet, alphabet + 26 ); ... (by jsmith)
connect problem with a socket
 
Hi everybody, I have an application that sends data to a GUI to represent it in graphics. It works properly but a few minutes later the connect() function fo...
[1 reply] : Do you know what error code 10061 stands for?... (by Incubbus)
web page input to C++ code
 
hi all I have a web page that contains a button. on click of this button an image is loaded from my hard drive. I want to send this image as the input to m...
[1 reply] : Where will the executable be? In the web server? Or in the end-user'... (by webJose)
can destructors take parameters?
 
could you write: class foo { foo() { //code } ~foo(int bar) { //code } }
[3 replies] Last: It is a C++ library to be used in the coming 0x C++ standard. http:/... (by Robertlzw)
by vRltwE
Troubles manipulating vector in two dimendions
 
Hi, I am writing a program organized in some classes divided into some files. In file gpa.h and gpa.cpp is the declaration of class gpa. In file gpa.h I d...
[2 replies] Last: I can offer two solutions. The first one involves boost and just re... (by jsmith)
Static member function overides inherited function with different arguments?
 
I cannot figure out why the following is happening. Maybe someone can inform me and hopefully point out a way around it. I have a base class, call it Indexed...
[3 replies] Last: OK. I've solved my own problem. I hadn't realized that creating a new ... (by DanielGr)
Asynchronous file read
 
Hello all, How can I open a file in asynchronous mode in a console application? I would like to open both ASCII and BINARY files, but first an ASCII file. Than...
[4 replies] Last: Hello webJose Thank you very much for your post. It is indeed clear a... (by kkamudu)
August 2009 Pages: 12345... 12
  Archived months: [jul2009] [sep2009]

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