49,757 Topics

Member Avatar for
Member Avatar for sciwizeh

Hello, I have a question, when does a global variable get destructed? ex. [code=c++]#include <iostream> using namespace std; class simple { public: int *i; simple(int ni){ i = new int(ni); } ~simple(){ delete i; } } simple simple1(10); //for simplicity no command line int main(){ cout<<*(simple.i) } [/code] when will …

Member Avatar for ArkM
0
3K
Member Avatar for iammfa

Hi all, what is the bug in the following code: [code=cplusplus] #include <iostream> #include <string> int main() { string str = "Hello World!" cout << str << endl; cout << float x = 5.0f * str << endl; int 65Num = 65; cout << "65Num = " << 65Num << …

Member Avatar for stephen.id
0
138
Member Avatar for hurbano

i have my program doing what i want it to do untill it gets close to the end. the ouput that is transferred to the word document is not right. i have random charactes appearing before the "Date:". how can i fix this minor problem?? Thanks [code=cplusplus] #include <iostream> #include …

Member Avatar for hurbano
0
166
Member Avatar for Intrade

I don't get it... Why is it that whenever I view posts of homework assignments and projects that a fair amount of the time (in Computer Science or C++), it seems as if-- Oh hang on. I already know what'll happen from here. If I don't write a topic that …

Member Avatar for MidiMagic
0
220
Member Avatar for cam875

Is this the best datatype to use for doing calculations for extremely large numbers such as computing pi . Or am I going to need to create my own algorithm for handling extremely large numbers? how does software like superpi handle such a large number, im assuming its all split …

Member Avatar for cam875
0
95
Member Avatar for hhilo2002

Hi all, I am quite confused about the usage of both. Both of them seems to enable a variable to be shared consistently between classes. Is the following true? [B]Namespace[/B]-used for defining some constant values that you want to share in your application. [B]Static variable[/B]-used to maintain a consistent value …

Member Avatar for Ancient Dragon
0
5K
Member Avatar for Matzbyy

Hi, so my problem is that when I write a program, and then try to debug it, there comes a error, on VC++ 6.0 there is "Cannot execute program" And in VC++ 2008 express edition it says, that there ain't the file I'm trying to debug. Here's the output; 1>------ …

Member Avatar for Ancient Dragon
0
95
Member Avatar for gretty

Hello I have just started learning programming & this problem is really stumping me. I have to do a syracuse sequence (explained below) & I know my code below is very wrong, (it needs to use for statements in there) but can you give me any advice on what to …

Member Avatar for Shabtai
0
518
Member Avatar for ganmo

Hello, I've written couple of overloaded operators in my file containing Set declarations. I want to use these operators within the declaration file. However it seems it isn't used. Instead it uses the standard operators. e.g. i have two overloaded operators say <= and == [code=cpp] bool Set::operator<=(const Set& b) …

Member Avatar for ganmo
0
128
Member Avatar for kcomeby

Hello and first sorry for my very bad english. i have little knowledge about c and c++ but im trying to learn win32 programming with c++. its little hard and im very new at that. im trying to do very very simple thing: i have an main window, 1 button, …

Member Avatar for stephen.id
0
179
Member Avatar for mathueie

Hi I am using eclipse.I got error.I am using g++ complier. *.o : file not recognized: File format not recognized collect2: ld returned 1 exit status Please any one help me..[B][/B]

Member Avatar for mvmalderen
0
4K
Member Avatar for Clockowl

Hey guys, I was wondering, with this code: main.cpp [code=cpp] #include <iostream> using namespace std; class car { public: car (float speed) : speed(speed) {} car () : speed(0) {} void cruise(float speed) { this->speed = speed; cout << "New speed: " << getSpeed() << endl; } void brake(float power) …

Member Avatar for stephen.id
1
242
Member Avatar for fadia

hi guys,, i've this homework that i have to submit tomorrow.. and unluckily I didn't know how to do it.. it says : Write a program that outputs "Al Eid Song" words.. "The five days of Al Eid" Use a [B]switch statement [/B]to display the following output for the 5 …

Member Avatar for karthik.c
0
122
Member Avatar for cam875

Im having a problem with the while loop in my code, if I change what X2 is being compared to to anything other than 0 it doesnt hit the while loop, I am hoping its just some weird mistake. Thanks in advance for any help. [CODE] X2 = 0.5; while …

Member Avatar for cam875
0
102
Member Avatar for Laik

I am going to make OS. And I need help with GUI...how to make an GUI ?...I am not on Windows so CreateWindowEx() doesn't exist.

Member Avatar for adam1122
0
124
Member Avatar for sciwizeh

Hello all, I'm trying to make a simple text box with SDL, I have loosely based it off of [URL="http://lazyfoo.net/SDL_tutorials/lesson23/index.php"]The Lazy Foo Tutorial on sting input[/URL], but this code doesn't seem to work... [CODE]if(event.type==SDL_MOUSEBUTTONDOWN){ if(isIn(event.button.x,event.button.y)){ hasFocus=true; } else { hasFocus=false; } } if(event.type==SDL_KEYDOWN){ if(hasFocus){ if(event.key.keysym.sym!=SDLK_BACKSPACE){ str+=(char)(event.key.keysym.unicode); } else { if(str.length()!=0){ …

Member Avatar for sciwizeh
0
142
Member Avatar for Akis2000

ok iam working on a password protection for my program but i have a problem..... if the user set wrong password the program do this Wrong password!! The program will be terminated in 5 seconds but i want sec, (which is my seconds) at every second - 1 5-4-3-2-1 without …

Member Avatar for Akis2000
-1
787
Member Avatar for xcr

Hello all, This is my first post but i have lurked around the forums for a while (sans account) my problem is thusly: I have written a program to take information from a data file, copying values to a vector, allow the user to add/delete and print form this vector …

Member Avatar for xcr
0
143
Member Avatar for badboizEnt

please i was wondering if anyone could help me with my code, i feel its kinda too long and a good program should be as brief as possible... please would be very grateful. appreciated, cheers.. [CODE=cplusplus]int _tmain(int argc, _TCHAR* argv[]) { string Username; string Password; int terminator = 0, terminate …

Member Avatar for ajay.krish123
0
129
Member Avatar for shasha821110

Hi, all I am trying to write the function to get rid of my punctuations. My code: [CODE] //_word_list is the vector<string> type void TextUtil::isnotpuct() const { for(size_t i=0; i<_word_list.size(); i++) { size_t len = _word_list[i].length() + 1; for(size_t j=0; j< len;j++) { if(ispunct(_word_list[i][j])) { _word_list[i] = ""; } j++; …

Member Avatar for ArkM
0
73
Member Avatar for syarolazuan

Write a program that reads in an array of type int. Provide facility to either read this array from keyboard or from a file, at the user’s option. The output for the file input option should be stored in a file while the output for the keyboard input option should …

Member Avatar for Ancient Dragon
0
775
Member Avatar for nschessnerd

Is there any way to mix visual c++ with normal c++? like can i enable mixed code? i want to get rid of this error: 1>tab.h(32) : error C4368: cannot define 'p' as a member of managed 'Monitor4vc::tab': mixed types are not supported

Member Avatar for nschessnerd
0
222
Member Avatar for myselfantara

Hello Everyone, I am a new member in the forum. I had a question regarding a code. The code is not able to open the input file. Any help is appreciated. thanks Here is the code, [ICODE] #include <iostream> #include <fstream> #include <cstring> #include <cstdlib> #include <iomanip> using namespace std; …

Member Avatar for mvmalderen
1
215
Member Avatar for Turyturbo

Hello, This is my first time using forum to ask around for some assistance. I will make it briefly. [code] void main() { char *StringPtr; //pointer of char char String[26]; //array of chars strcpy(String, "abcdefghijklmnopqrstuvxyz"); if((StringPtr = new char[26]) == NULL) cerr << "\n\a allocation failed" << endl; else cout …

Member Avatar for ThundrbltMN
0
243
Member Avatar for shasha821110

Hi, all I got stuck by the erase function usage. here is my code: [CODE=C++] //A is my class //this function is used for judge weather there is a punctuation in //the word and get rid of it. void A::isnotpuct(const string& wordlist) const { size_t len = wordlist.length() +1; for(size_t …

Member Avatar for Narue
0
77
Member Avatar for yashyash

Dear friends I have a conversion from ascii to binary while when i use my input which is like this : 16078 16283 0.3708 16078 16837 0.4514 16078 17820 0.4038 16078 17906 0.3695 16283 16837 0.3905 16283 17820 0.4343 16283 17906 0.3262 16837 17820 0.5291 16837 17906 0.6245 17820 17906 …

Member Avatar for yashyash
0
86
Member Avatar for ashishchoure

hi, can anybody tell that how do we get group SID. we have user SID but how can i know to which group that SID belongs

Member Avatar for ashishchoure
0
110
Member Avatar for hurbano

hello im having problem trying to get this to do what i want it to do. after the program asks if the user has had any work up to date, i want it to ask for specification if the answer is yes, or go to a next question if no. …

Member Avatar for mvmalderen
0
247
Member Avatar for everard

I'm creating a program in Visual C++ and the program I'm creating needs to read a data in an Excel document. It was saved in .xls format. Can someone help me on how to read data in an Excel file. No need for writing or editing the excel document, just …

Member Avatar for mvmalderen
0
332
Member Avatar for lllllIllIlllI

Hi, I have been exploring doing some GUI programming with the wxWidgets toolkit as i am used to that from programming wxPython in python. I am doing the tutorials from zetcode and i am very mystified. (i think i spelt that wrong). This is the url [url]http://zetcode.com/tutorials/wxwidgetstutorial/menustoolbars/[/url] Its the first …

Member Avatar for lllllIllIlllI
0
117

The End.