473,612 Members | 2,181 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C / C++ Forum

C / C++ programming language - Get answers to questions about compilers, visual C++, templates, namespaces, classes, data structures, OOP (object-oriented programming), inheritance, data types, exceptions, Standard Template Library (STL) and the C Standard Library.
1
2,718
thread by: las | last post Jul 19 '05 by: Simon Saunders
#include <iostream> #include <fstream> #include <stdlib.h> #include <string> int main() { string token1 = "Hello\nall"; fstream newfile("C:/temp/test1.txt", ios::trunc); if ( newfile.good() )
1
1,787
thread by: philhowell | last post Jul 19 '05 by: philhowell
i'm very new to C++, but feel it may hold the answer to what i'm after, i want to send an email if more than four applications are being run on a PC.... can this be done, if so how..........??? cheers Phil -- Posted via http://dbforums.com
3
1,874
thread by: Peter Olcott | last post Jul 19 '05 by: Andrew Koenig
Everything in this program produces the correct results except the part dealing with the RealList. The "for" loop does not output the values that were input to the ALL.RealList. What is the correct syntax to for this? Thanks #include <stdio.h> #include <string> #include <vector> union AllType {
0
2,505
thread by: james545 | last post Jul 19 '05 by: james545
I am having a problem with ofstream creating files. Sometimes when I run the program, ofstream creates a new file for writing and writes to it. No problem. But sometimes it fails to create the files altogether. Why doesn't it create files consistently? (My disk isn't full, and the file didn't previously exist) Thanks for your help. ...
1
4,429
thread by: Marc Schellens | last post Jul 19 '05 by: Dietmar Kuehl
When I do: static const ios_base::openmode emptyMode = ( ~(ios_base::app| ios_base::ate| ios_base::binary| ios_base::in| ios_base::out| ios_base::trunc));
2
1,798
thread by: kamilem | last post Jul 19 '05 by: kamilem
How to write an function which will be abble to block popular hot keys (e.g. Alt+Crtl+Del; Alt+F4; Alt+Tab; Crtl+Esc (start menu); Alt+space bar) and win button (on windows keyboard) thanks for help -- kamilem
9
2,539
thread by: Philip Lawatsch | last post Jul 19 '05 by: Philip Lawatsch
Hi I'd like to implement some kind if type traits myself, but I have to support broken compilers (like visual studio) that do not support Partial Specialization. My first shot was something like this: ----8<--- typedef char IsPODForListArrayTrue;
1
4,746
thread by: Ahmed Ossman | last post Jul 19 '05 by: Russell Hanneken
Hi Group, I have a serious question here, I got the following error after a two warnig as following: /opt/SUNWspro/bin/CC -Dsun -Dsparc -D_SYSTYPE_SYSV -DSYSTYPE_SYSV -DMK_VENDO R_CC -xO4 -DNDEBUG -DNDEBUG -I/project/qsim/iwa/simview_ss8/mgc_home.ss5/sha red/include -I. -IIsrc -I../glue -G -Dvco_ss5 -I/usr/opt/purify -I/usr/opt/p urecov...
12
6,114
thread by: John Harrison | last post Jul 19 '05 by: Rob Williscroft
Slightly surprised that the following didn't compile #inclue <algorithm> enum { C = 10 }; int main() { char a; std::fill_n(a, C, '\0'); }
13
5,788
thread by: E-Star | last post Jul 19 '05 by: Mark McIntyre
I have a binary file that I want to read some numbers out of. However the numbers are 32bit floats. How can I get the numbers into a C program to use? I can do the calculations manually....but is there an easier way? Is there some handy functions which do this? example. File contains: 42 7C 00 00 I want to read it in and end up with...
1
1,502
thread by: Matt | last post Jul 19 '05 by: Peter van Merkerk
Dear All, I am looking to buy a laptop computer with a 14.1 inch monitor that is as light as possible. Do you have any suggestions as to what to buy? Ideally, I'd like to get something under 4 pounds, though I understand that may be impossible? Please forgive the off topic post, and if you know of any good newsgroups to try instead, that...
3
1,927
thread by: joe martin | last post Jul 19 '05 by: Francis Glassborow
Does anyone know when or if destructors for statically declared objects are called? I am just wondering if I am leaking system resources each time i exit my program. Thanks, -Joe http://www.gotw.ca/resources/clcm.htm for info about ]
3
9,431
thread by: sam pal | last post Jul 19 '05 by: E. Robert Tisdale
I have the following programs and please clear my doubts. Passing the value by reference is same as pointer by reference. Is this true? What is the difference between display and display2? How can I change display1 to value by reference if there is difference? void display(int &i){// Passing value by reference
2
5,119
thread by: Kalpana Shridhar | last post Jul 19 '05 by: paul
I am on a project where I am converting COBOL to C++ on the mainframe. I am new to COBOL and have a lot of questions - any websites or any suggestions from experienced people will be really appreciated. My main issue is with the CALL routine - I have to call a external function which I believe is Assembly. Right now the call is made using 4...
6
7,188
thread by: alg | last post Jul 19 '05 by: Samuele Armondi
Is it possible to put different types of objects in a single STL list? If not what STL template should be used which will contains various objects of different types? Thanks for your help!
17
3,068
thread by: Tom | last post Jul 19 '05 by: Cy Edmunds
The motivation for references seems clear: stop people from using nasty pointers when all they really want is a reference to an object. But C++ references are so inadequate that I'm still using pointers for my references to objects. There are 3 reasons why I find them inadequate: 1 - Can't be null. 2 - Can't be reseated. Now I'm sure...
2
1,668
thread by: nobody | last post Jul 19 '05 by: E. Robert Tisdale
I NEED HELP IN BUILDING PROGRAMS THAT CAN EDIT THEMSELVES...U KNOW.. THAT SORT OF CODE CHANGING ONE'S OWN CODE???? PLEASE CONTACT ME IF U COULD HELP...
0
1,599
thread by: qazmlp | last post Jul 19 '05 by: qazmlp
Does static member function of a class have 'extern "C" linkage ? And what about non-static member functions ?
2
19,902
thread by: gukn9700 | last post Jul 19 '05 by: gukn9700
The following program opens a text file and wants to append new text to it, but everytime I run it, it returns me with "open file fail!". Can anybody help? #include <fstream> #include <iostream> #include <cstdlib> using namespace std;
7
8,025
thread by: Paul Davis | last post Jul 19 '05 by: Paul Davis
I'd like to overload 'comma' to define a concatenation operator for integer-like classes. I've got some first ideas, but I'd appreciate a sanity check. The concatenation operator needs to so something like this: 1) e = (a, b, c, d); // concatenate a,b,c,d into e 2) (a, b, c, d) = e; // get the bits of e into a,b,c, and d For example,...
4
2,668
thread by: josef angermeier | last post Jul 19 '05 by: josef angermeier
i wrote a display driver for a lcd segment display which doesnt recognize ascii character so that each character of an output string needs to be converted byte by byte by looking in a const character table. in short, when calling my output function display.output("hallo") i dont want to call the output function at runtime with the ascii...
4
5,168
thread by: crashnburn | last post Jul 19 '05 by: Charles Wilkins
Hi there, I was wondering if C++ has some kind of default new socket wrapper, that avoids many lines of code. Maybe there is a good C++ library? Any ideas? I'm using UNIX, but portability would be great. Regards
8
5,725
thread by: Marc Schellens | last post Jul 19 '05 by: Karl Heinz Buchegger
I want to use an auto_ptr to a buffer: auto_ptr<char> buffer = new char; But this does not work, as auto_ptr calls delete instead of delete, right? What I can do? Is there a version of auto_ptr calling delete? thanks,
7
1,799
thread by: Eternally | last post Jul 19 '05 by: mjm
Ok, this may sound confusing....but it's really simple. If you're confused, just look at my example code and it'll make sense. Here's my situation. I have 2 classes....A and B. Class A has a member variable of type B. Class B has a member function which does calculations which are dependent upon values of members of the Class A that...
0
1,538
thread by: Nishant Saxena | last post Jul 19 '05 by: Nishant Saxena
"VoluMetrix" <volumetrix@volumetrix.com> wrote in message news:Ymb0kSBMcmF$EwNC@volumetrix.com... > Using vc6 sp5 the following code fails during delete, due to the base > class having a virtual destructor. > > Is this a known issue, and is there any ms documentation on it? > >...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.