bitset object initialization

558 byte By mop65715 at 2007-11-20 10:29:02
# include <bitset># include <iostream>int main() { std::bitset < 24 > bs_a ( 0xFF ) ; // later create another bitset object std::bitset < 24 > bs_b ( 0xFFFF ); //std::cout << bs_a << std::endl; return EXIT_FAILURE ;}Two bitset objects are initialized with...

Cygwin: uname

351 byte By choconlangthang at 2007-11-20 10:29:14
Hi everyone,I'm using cygwin on WinXp. I checked and found that uname.exe , dirname.exe are in cygwin directory already, but when I execute a bash file having uname, dirname it said : command not found.I tried to reinstall, but I can't find under which package (Admin, net,...) they are. Pl...

about HKEY_CLASSES_ROOT TypeLib

545 byte By George2 at 2007-11-20 10:29:33
Hello everyone,If I am developing a native unmanaged COM using Visual Studio 2005 C++, is it a mandatory to register type lib into HKEY_CLASSES_ROOT\TypeLib?I have already registered related entries into HKEY_CLASSES_ROOT\CLSID\<Co Clas ID>, HKEY_CLASSES_ROOT\Interface\<Interface ID of Co C...

Need help writing a simple program

1428 byte By devildog at 2007-11-20 10:29:35
Hi everyone,I am a newbie that is taking a class to introduction C++ program. I am spending way too much time trying to figure out how to write the program and I need to use some of these time that I am trying to figure out stuff in C++ to study on my other classes. So please give me a hand. My proj...

[RESOLVED] Reading file.. Help

238 byte By blurkx at 2007-11-20 10:29:37
Hello,<br/>Am new to programming. I have a problem with reading a file. I read the file and stores the values. But the program crashing.. Anyone here to help ? I will send the source code n the file. <br/>Thnks.<br/>Regards

return of main..

163 byte By Rooting at 2007-11-20 10:29:39
can I return main whith 0x0??..<br/>int main() {<br/>return 0x0;<br/>}<br/>the compiler don't show nether error nor warring..<br/>thanks..

istance and object..

421 byte By Rooting at 2007-11-20 10:29:53
An object is an instance of a class. It can be uniquely identified by its name and it defines a state which is represented by the values of its attributes at a particular time.in a normal class same this:class dev-archive {public ://attributesfloat javascript;float a;float b;//methodfloat add() {ret...

addition without operators?!

1408 byte By kevinskrazyklub at 2007-11-20 10:30:08
im taking discrete mathematics which is a freshman class,(this is what the program is for) and i've only taken one cs class to go towards my degree. I'm having trouble figuring out this program. you cant use any operator whatsoever except == && || = ! and thats about it. im not proficient...

Win32 login program

4751 byte By darkboarder297 at 2007-11-20 10:30:11
#include <cstdlib>#include <iostream> #include <stdlib.h>#include <string>#include <stdio.h>#include <conio.h>#include <unistd.h>#include <fstream>#include <windows.h>#include <vector>using namespace std;int main(int argc,...

Another Q on Virtual table

908 byte By mce at 2007-11-20 10:30:12
For each class, as long as there is a virtual function, there will have a virtual table created. Is this statement correct?Then, looking at the following code:class Base{public: Base(){ }; virtual ~Base(); method(){ }; virtual func(){ };};class Derived : public Base{public: Derived(){ }; ~Deriv...

string to some type of number

385 byte By michael1991j at 2007-11-20 10:30:14
hi i am trying to convert a char to some number were i can convert it back to text later on #include <iostream> using namespace std; int main(){char a = 65;cout << a << "this is a";system("pause");}this is the way you can show a by having the numberbut how do you find the number w...

iterator from const_iterator

236 byte By miclus at 2007-11-20 10:30:16
Hi. I've been studying some STL list implementations and was wondering why class iterator doesn't inherit from class const_iterator? I'm guessing there is a downside to inheritance in this case that I'm not seeing.

analysing sorting algorithms

898 byte By xlonehats at 2007-11-20 10:30:17
pliz can anyone help me...im writing a program which analyses some sorting algorithms...the output should show the different algorithms used and the average processing time each one of them took....i) im a bit confused in using the clock() methods...as most of the time it returns mostly 0sec...im im...

Pls dissect this...

1279 byte By silentwings at 2007-11-20 10:30:25
Hi!I'm new in c++. I understand a little bit... But i couldn't fully grasp the idea... we are ask to make a simple bankaccount program and enhance it and gave us some idea on how to start. Unfortunately i do not understand some of it. For starters I know what class is. Problem is I have tr...

Why operator= is private when implementing Singelton

187 byte By code_carnage at 2007-11-20 10:30:34
Hello guys is there any logic behing meaking operator= private when impelmenting singelton or mayer's singelton..<br/> <br/>I dont see any logic..<br/> <br/>What are your opinion...?

C++ My On-Screen Keyboard - Problems with focus

943 byte By tacky at 2007-11-20 10:30:35
Hello guys :PI have a litte problem with my C++ programm. I want to programm an on-screen keyboard like the one from windows. Most of the work is done but i have no idea how to manage this problem.With my keyboard I want to write in other windows but how can i get the focus to them. If I want to pre...

need help! cstring.

665 byte By kb8coolj at 2007-11-20 10:30:37
Hi, I desperately need help because I do not know how to make a list of c strings. The problem asks for this:2) Print a list of size 4 of names (where each name has at least 3 characters). Construct these names using for loops and ASCII codes.There is no user input.For 2) The strings will have no bl...

variables

435 byte By Rooting at 2007-11-20 10:30:51
Hi friends.I have 5 variuables such thisint d1,d2,d3,d4,d5;and a for cicle such this;for ( int i =1; i <= 5; i++) {}i wont to write the variable the same numer same i;i would not ro write 5 time cout << d1, cout << d2 but whith the forcicle such as:i = 1 -> variable d1i = 2 ->...

converting unsigned __int64 to double in assembler

2099 byte By myhanguk at 2007-11-20 10:30:53
Hmm... sorry guys and gals... I misposted this one, I noticed too late that there is also an assembly section on this forum... It seems I can not delete this post, so... In any case, if you can help me too, you're most welcome of course^^Hi...I am faced with the VC++ limitation that generateser...

possible useful class

526 byte By dave2k at 2007-11-20 10:31:00
Very often i am using C APIs which require me to call an intialisation function and an ending function. There are lots of 'function pairs' such as GlobalAlloc and GlobalFree etc...I thought about creating a simple template function which took in two function pointers as it's types and...

TWo singelton implementations which one is better...

720 byte By code_carnage at 2007-11-20 10:31:34
class Singelton{private: static Singelton* single; Singelton() // All constru including copy and assignment private { }public: static Singelton& createInstace() { if( !single) single = new SIngelton(); return *single; }}SIngelton* Singelton:: single = NULL; class Singelton{private: Sing...

request for compile r2vdll for vb6

234 byte By mehdi0016 at 2007-11-20 10:31:49
hi<br/>i want to how can i use r2vdll in vb6 ?<br/>it is a free raster to vector lib :<br/> http://xmailserver.org/ras2vec.zip <br/>it contains a DEF file ,but i have problem in Declare ,variables ,data types ...<br/>plz help me.

I have a newbie question about input data type caparison

1887 byte By bullserpent at 2007-11-20 10:31:54
This is my first program in like 7 years, I took a class in C++ that long ago. Now I'm taking another one so...I would REALLY appreciate a little bit of help if possible.I DID read the faq about homework, and this is technically a homework question, for that I will apologize in advance, sorry e...

Serial controller algorithm

796 byte By kenneth_888 at 2007-11-20 10:32:04
hi all,i would like to implement a serial controller controlling 7 segment display to c++.Can anyone just give me an algorithm so i can apply it to c++ coding??i dont need the code just plain simple pseudo code will do.The controller decodes incoming hexadecimal encoded in ASCII text stream.Assume...

Need help!

1044 byte By devildog at 2007-11-20 10:32:05
hi everyone,previously, I asked for help with a program and you guys been awesome. Thanks.Now, I emailed the instructor and discovered that the program I wrote was not correct. I misunderstood the question and created a different solution.the instruction were to:The first part of the assignment is s...

convert string to array..

406 byte By Rooting at 2007-11-20 10:32:26
i would realize the crammer method for resolvethe linear sistem..so i put the 2 equation in a string, and i would convert toan array o a vector, to find after the variable x.how can i convert string ??and there is a function to find the variable x orI do whith a for statmente, such asfor ( int i = 0...

restricting file sharing

696 byte By Brad.G at 2007-11-20 10:32:53
here's my scenariomy son has a computer in his bedroom, and i have films on my computer which he connects to via a shared folder to watch them.the problem is, i have to keep checking to make sure he's gone to bed and isnt watching another one.naturally, im turning to C++ to design a little...

Two copys of vectors will be created or one only

1107 byte By Rajesh1978 at 2007-11-20 10:32:59
I I am not able to clear thisI have a dll which contains a class like class Test{ vector<int>myVector; public: test(0{} vector<int>getVector(); // This function populates the vector //and returns the vector I sm noy writing the code}//// I...

RegEx expression help

458 byte By DeepT at 2007-11-20 10:33:03
I am not that good with RegEx, but I have what should be a simple problem and I do not know how to express it as a RegEx.I want to create a pattern that will match "| data |" from a large block of text, only I want the return to be "data" and not " | data |".I can't figure out how to say fi...

Testing speed of program

563 byte By Antwerpen at 2007-11-20 10:33:05
Hello,I need to have a fast program, and for testing the speed of my operation I am using this simple code:int main(){clock_t a=clock();...//here are all operations of the program...clock_t b=clock();cout<<"Time used by the program:"<<endl;cout<<((b-a)*1e3)/CLOCKS_PER_SEC<<"...

__LINE__ and __FILE__ as template arguments

1335 byte By rpmivh at 2007-11-20 10:33:13
I want to pass __LINE__ and __FILE__ to a function in a 'clean' way, hopefully without globals, member variables, or much overhead. I was hoping to use template arguments. I tried the following scheme with a few errors.#define Log_MyFunction MyFunction< __LINE__, __FILE__ >class CS...

pass a single element of an array of structures as a reference

272 byte By quad99x at 2007-11-20 10:33:16
struct TEST{<br/> int a;<br/> int b;<br/> };<br/>struct TEST objTest[2] = {{1,2},{3,4}};<br/>change(); //pass by reference one of the elements<br/>change() {<br/> //manipulate the passed element here<br/>};<br/>How do you pass that by ref?

Rogue Wave compiler issue

281 byte By mtronix at 2007-11-20 10:33:24
Hello,<br/> When i try to compile a legacy project I get the following error.<br/>Unresolved external '__rwstd::__rw_stdexcept_NoNamedException'<br/>I think I have tracked it down to Rogue Wave software. Does anyone know how to remedy this?<br/>Thanks

having trouble with one function

9892 byte By kevinskrazyklub at 2007-11-20 10:33:29
i've been working on this program for a while now, and i decided to make a new thread on it to start fresh.this is not a typical program, i am adding two integers up by using two tables: the carryTable and the addition table. something in add() is causing a miscalculation of non one digit numb...

c = a + b ...: simple?

1526 byte By myhanguk at 2007-11-20 10:33:53
Hi...I have the following (challenging?) problem:Let's assume that I have a class for fixed point numbers cFixed.Among the member variables are parameters such as bitwidth, sign mode, scale, and the integer fixed-point value itself of course.My question is then as follows:I would like to create...

file I/O

252 byte By xlonehats at 2007-11-20 10:34:03
hey all...im writing a program which calculates the efficiency of different sorting algorithms...i have to output the results into a file but there is problem in it.....as long as i enter more than 3 elements to be sorted, there is an error showing...

Memory allocators to over internal fragmentation

1190 byte By sihem at 2007-11-20 10:34:34
I am dealing with internal memory fragmentation issues in my program (C++ program on freeBSD). It involves a large number of fixed-size structures.For example for my records which are typically fixed at 100 bytes, the default allocator allocates 128 bytes (closest power of two) wasting 28 bytes per...

Simple Question, Ascending Order

1292 byte By prof101ar at 2007-11-20 10:35:14
Small & Simple program fragment that will output 3 integers. The problem is that I'm not sure how high I should place the value on my outer loop control variable, if I give the user the option of choosing as high a number as they desire.Take a look...#include <iostream.h>int main(){ int a...

Problem in Map

1834 byte By Rajesh1978 at 2007-11-20 10:35:48
Hi please see the following code. I am using Map for the first time and facing this problem. class Name { char str[40];public: Name() { strcpy(str, ""); } Name(char *s) { strcpy(str, s); } char *get() { return str; }};// Must define less than relative to Name objects.bool operator...

Inheritance and data members

441 byte By Bless at 2007-11-20 10:35:50
I want to inherit from the Person class so that the data members(name,surname and age) can also be displayed on the output from the inheriting class Employee.Can anybody help me with this attached piece of code. e.g. OUTPUTname: JohnSurname:TravoltaAge: 19name:JohnSurname:TravoltaAge:19hours worked...

no mouse

358 byte By coricori at 2007-11-20 10:35:58
hi therei need to move my mouse with direction keyboards but without my application to be active. i need o make something as Control Panel-> Accessibility-> Mouse-> Use Mouse Keys.can u help me with some advices?i think i need to hook to mouse ( corect me if i'm vrong ). can u help me...

Whats wrong with cin.get()?

1061 byte By .pcbrainbuster at 2007-11-20 10:36:19
Sup guys,In the following code the cin.get() does not make the program wait for the user to press enter, why? -#include <iostream>using namespace std;int main(){ system("TITLE Test Program"); system("COLOR 1"); int number1, number2, number3, average; cout << "Please input 3 numbers seper...

Multiple Instance Error

844 byte By lyar1031 at 2007-11-20 10:36:20
Take a look at this code snipet. It consists of 2 .c files and a .h file. ;--------a.c-----------#include <stdio.h>#include "b.h"int main(void){ foo();}//--End of File;--------b.c-----------#include <stdio.h>#include "b.h"void foo(){ myID++; printf("%i\n",myID);};--------b.h----...

User Library and makefile

598 byte By sidkdbl07 at 2007-11-20 10:36:42
I'm just getting familiar with C++, so here's a noob question...I have a bunch of .h and .cpp files in a directory ~/ABC/My code is in ~/Code/What is the best way to include files from the ABC directory?Here is my makefile:CC=g++CFLAGS=-c -WallLDFLAGS=SOURCES=main.cppOBJECTS=$(SOURCES:.cpp...

Handling the Time

886 byte By Bazman at 2007-11-20 10:36:43
Hi,I have to write a function that takes the time as 3 integer arguments (hours, minutes and seconds) and returns the number of seconds since the last time the clock "struck 12". I am then meant to use the function to calculate the amount of time in seconds between two times, both of which are withi...

How to get the all possible words from a given word.....!

2193 byte By milindasuren at 2007-11-20 10:36:44
hay buddies... i m a computer science student in the 1st semester... we v given a small puzzel...that is to get a word ladder from the first and last word given...u only can change one letter at a time stating from the first letter to go for the last word...the words are checked for the existance f...

strncpy

182 byte By ikcha at 2007-11-20 10:36:49
char mycbuf[100];<br/>mycbuf[0] = '\0';<br/>strncpy(mycbuf, cbuf+5, 10);<br/>mycbuf will have "mystring" plus some trailing characters. it wouldn't be only "mystring".

Error in simple code

1043 byte By snakeq at 2007-11-20 10:36:50
Before everything, I'm a beginner programming C++ I wrote this code today, I compiled it and ran it. But later I moved line 12 a little bit, I think I moved some parenthesis, but I don't know. My issue is that it keeps telling me there's an error on the code, in line 12 but can't...

enum & value returning function

3963 byte By douche at 2007-11-20 10:37:01
Hi, first time here so I hope that I'm following the rules. I tried finding a solution here similar to my problem and also on this google website that people keep telling me about, but no luck. I'm sure there is something simple I am overlooking, with the following code:#include "stdafx.h"...

std::cout with std::map

136 byte By __OTO__ at 2007-11-20 10:37:08
Hi,<br/>I would like to know how I can define an "<<" operator to print what is in a std::map with st::cout.<br/>Regards