49,761 Topics

Member Avatar for
Member Avatar for eranga262154

Hi all, I'm working with some date formating, with local and UTC time format. At the end I've print the result to the console as follows. [CODE] cout << stLocal.wMonth << "/" << stLocal.wDay << "/" << stLocal.wYear << " " << stLocal.wHour << ":" << stLocal.wMinute << "\n"; [/CODE] …

Member Avatar for eranga262154
0
138
Member Avatar for dougy83

Hi, I recently read that memory leaks can occur when using the string stream str() member function ([url]http://www.troubleshooters.com/codecorn/memleak.htm)[/url]. Is this true only for passing pointers or references to the created string object? Is this true at all? For example, can anyone see if the following code would cause a leak …

Member Avatar for dougy83
0
2K
Member Avatar for tootypegs

Hi my problem is as follows. I want to stream a certain amount of bytes from usbimage2.txt until my buffer is full then write them to new.txt. My first problem is my buffer. If i give the buffer a value of say '4' it compiles with no errors. However i …

Member Avatar for Duoas
0
82
Member Avatar for kv79

Hi a have a problem. [code=cpp] //BUTTON CONTROLS - Copyright © 2000,2005 Ken Fitlike //============================================================================= //API functions used: CreateWindowEx,DefWindowProc,DispatchMessage,GetMessage, //GetSystemMetrics,LoadImage,MessageBox,PostQuitMessage,RegisterClassEx, //SendMessage,ShowWindow,UpdateWindow,TranslateMessage,WinMain. //============================================================================= //This demonstrates the creation of the following button types: default push //button,push button,check box,radio button and groupbox. The image style of //'bitmap' buttons (BS_BITMAP) and 'icon' buttons (BS_ICON) …

Member Avatar for Duoas
0
544
Member Avatar for kv79

Hi ,i just have a fhew code witc i do not understand clear.Can you make some explain. It is category from C++ Win32 API. [code] typedef std::basic_string<TCHAR> ustring; inline int ErrMsg(const ustring& ); What this mean ustring& ? [/code] [code]ustring classname=_T("SIMPLEWND"); ErrMsg(_T("Failed to register wnd class"); [/code] // And i …

Member Avatar for kv79
0
171
Member Avatar for sana_akram

can we send the input from command prompt screen to the text file in C++ if anyone know plz tell me about it briefly

Member Avatar for WaltP
0
106
Member Avatar for mrjoli021

I cant get the program to compile I am getting 'system': identifier not found I have the following includes #include "stdafx.h" #include "Email.h" #include <iostream> #include <fstream> #include <String> #include <cstdio> #include <stdlib.h> [code] #pragma once using namespace System; namespace Email { public ref class Class1 { private: void telnet …

Member Avatar for Duoas
0
235
Member Avatar for mr.cool

hi, i need help with how to find the max number and min number from an array. there are 31 numbers, i know that i am suppose to use a for loop to do this and this is what i got so far array is inputed by user [code] #include …

Member Avatar for mr.cool
0
109
Member Avatar for HLA91

Hi all I was looking for a port scanner to see what was open on my laptop and I thought as I was learning C++ why not search for a C++ port scanner. I came across this code I can make sense of most of it but it wont compile. …

Member Avatar for Duoas
0
1K
Member Avatar for mrjoli021

I am having some isues adding std as a namespace. I am using vs2008. don't know if that has something to do with it. [code] #pragma once //using namespace System; using namespace std; namespace Email { public ref class Class1 { private: void telnet () { system("dir"); } }; } …

Member Avatar for Duoas
0
579
Member Avatar for uthnim

helllo everyone, i am writing a C++ program using ifstream. There will be two text file_ one with balance of the customer's account, and the other with the customer's purchase. Just like this. 100 1000.00 101 2000.00 102 3000.00 103 4000.00 the above is the balance.txt with customer nos (100 …

Member Avatar for Duoas
0
137
Member Avatar for mrjoli021

I am new to c++ classes. I am trying to write a simple e-mail class. below is my .h file. In the cpp all I have is the main which is empty right now since it wont even compile. I am getting cout and endl as an undelclared identifier. I …

Member Avatar for mrjoli021
0
194
Member Avatar for tehprince

I have the following program I need to write: I need to read in a line of text and then output a list of all the letters that occur along with the number of times each letter occurs. An array with a struct type as its base must be used …

Member Avatar for VernonDozier
0
147
Member Avatar for mrjoli021

I am writing a program that requires me to call certain dos commands. I am using the system function like: system("attrib -h"); when I try to compile it I get error C3861: 'system': identifier not found I am using vs2008 any ideas did the command change??

Member Avatar for mrjoli021
0
107
Member Avatar for wijitha

hi all.. Can any one explain, when i have class Pet, what is the difference of declaring variables like each of following. Pet mypet; Pet mypet = new pet(); Pet* mypet = new Pet(); thanks.

Member Avatar for invisal
0
89
Member Avatar for eranga262154

Hi all, I've use a CStringArray to store some CStrings in my application. Now I want to use another CStringArray on the same application. So I add another CStringArray instance on the class view, VC++ .Net 2003. When I add and compile it don't give any error message. But when …

Member Avatar for eranga262154
0
911
Member Avatar for jsully1

I am currently going to school for a CS degree and I was wondering what people would recommend doing to keep my programming skills up to date. I can only take about 2 classes a term and some of programming classes are really spread out making it hard to remember …

Member Avatar for jsully1
0
189
Member Avatar for deicer

I have a program that needs to replace all occurrences of the words "Giants" with "New York Giants". So the following line: The Giants won a big game today, it was the first playoff win for the Giants in 7 years Would convert to The New York Giants won a …

Member Avatar for Ancient Dragon
0
125
Member Avatar for omeralper
Member Avatar for twomers
0
139
Member Avatar for FoX_

Hi all; I have to create a Binary Tree(not a Binary Search Tree) whose node values are produced randomly... If I had to create a Binary Search Tree , I could determine where the current node has to be inserted but in a Binary Tree I can't determine where the …

Member Avatar for VernonDozier
0
154
Member Avatar for tehprince

I need to write a program that will take in a sentence and then outputs the # of words in the sentence, as well as the each letter with it's occurrence in alphabetical order. Example: Hello World. Would output: 2 words 1 d 1 e 1 h 3 l 2 …

Member Avatar for WaltP
0
126
Member Avatar for jin83

Hi! I am quite new at programing. I want to write a program that reads a textfile and then prints the content on the screen 25 rows at the time. I have read quite much about ifstream and ofstream. I wrote this program to count the lines in a file. …

Member Avatar for Ancient Dragon
0
362
Member Avatar for hashinclude

Hello, i need help on how to search for a sentence inside a txt file after opening it and then applying a condition if that sentence was found. im a beginner so i don't know how. basically i have written a program that uses system("command>file.txt") to start a command line …

Member Avatar for hashinclude
0
471
Member Avatar for Red Horse

What would be a good book for C++ starters? I'm just new to this particular language, not to programming itself. Any idea of what to start with to make almost an expert (part of it is a joke :). At this point only the depth of knowledge and time, time …

Member Avatar for invisal
0
92
Member Avatar for rajatC

I want to write all the output to the output file and don't want to print on the console output...the file (in which the output has been written) should be opened after i run the program. which function to use for opening a file to see output( at run time)?? …

Member Avatar for rajatC
0
166
Member Avatar for jobluz06

I am trying to write a short RPG like program to teach myself C++. I would only like the program to allow the user to by items (sword, shield, etc.) from a store and add them to their list of items. I'd also like for these items to be objects …

Member Avatar for phalaris_trip
0
120
Member Avatar for kaly45

Hi every one : I need help with this C++ coding: Write a program that defines and uses a class called Student. A student class should contain the following private data: Student Number Full name An array of 7 marks for courses in the semester Your class should have a …

Member Avatar for ithelp
0
110
Member Avatar for dhananjay1984

hi all i am using mfc dialo based application vc++ 6 for my software development. i a button on box, connect and placed my code under connect buton tab. when i run the application and press connect buton dialog box frezez and i cant even cancel that. so please help …

0
53
Member Avatar for deicer

I have the following code which removes duplicates from an array: [code] #include <iostream> #include <algorithm> #include <vector> #include <iterator> using namespace std; char main() { char myarray[10] = {'a', 'b', 'b', 'b', 'b', 'c'}; int myarraylength = 5; string holdprogram; vector< char > myvector(myarray, myarray + (myarraylength + 1)); …

Member Avatar for tehprince
0
108
Member Avatar for tomekk001

Hello, I need to install Microsoft MapPoint component in Borland C++ Builder 6. I'm trying to use ActiveX control. But standard procedure Project->ImportTypeLibrary doesn't work. There are errors during compilation of library. Does anyone know what I do wrong? Tomek

Member Avatar for davemaster
0
2K

The End.