48,986 Topics

Member Avatar for
Member Avatar for iammfa

since few minutes I tried practice "using FOR loop with IF statement" to test user "Even Numbers"(divided / 2) in console screen, I wrote this trivial program to print the statement "IS even number" if the number divided by 2, and print "NOT even number" when not divided by 2, …

Member Avatar for WaltP
0
97
Member Avatar for delhiris

What is this->Controls->Add(color);? What will happen if code below is without this->Controls->Add(color);? What is the result from the code this->Controls->Add(color);? color=new Button(); color->Text="Ok"; color->Top=320; color->Left=420; this->Controls->Add(color);

Member Avatar for jonsca
0
80
Member Avatar for mybluehair

I hear that to create a custom icon for your exe file, and must create a .ico icon, then link it to a resource file, which is linked to the main .exe file. I'm not sure how to do this though. I have my icon I want to use for …

Member Avatar for HealBrains
0
95
Member Avatar for e40thrilla

I'm writing a simple program that reads a text file and counts the vowels in it and outputs how many are included. With the code I have I keep getting the wrong number of vowels outputted. Can anyone see where I made a mistake, I can't figure it out. my …

Member Avatar for mitrmkar
0
1K
Member Avatar for jonyb222

Arrival.o: In function `NodeItem': /home/jonyb/Desktop/A3-Q2/NodeItem.h:5: undefined reference to `vtable for NodeItem' Arrival.o: In function `~Event': /home/jonyb/Desktop/A3-Q2/Event.h:8: undefined reference to `NodeItem::~NodeItem()' Event.o:(.rodata._ZTI5Event[typeinfo for Event]+0x8): undefined reference to `typeinfo for NodeItem' These 3 errors repeat themselves for all my files accessing NodeItem.h and NodeItem.cpp Now I've looked around and all I could …

Member Avatar for jonyb222
0
8K
Member Avatar for tomtetlaw

The function, std::vector.push_back takes a paramater of the type: [const t &]. with t being the type that the vector was constructed with. What I need to do is convert [*this] to a [const t &]. Is there any way that I can do this? This is the code that …

Member Avatar for tetron
0
97
Member Avatar for picaz

I am trying to get 'SERVERPROPERTY ('edition') using ADODB. I have a connection to a database but I keep getting Error 80040e14 and unexpected token SERVERPROPERTY was found following BEGIN-OF-STATEMENT. Any ideas how to fix this. Thanks Joey

0
74
Member Avatar for vidit_X

Question by ~s.o.s~ Write a program which will perform the job of moving the file from one location to another. The source and destination path will be entered by the user. Perform the required error checking and handle the exceptions accordingly. (Intermediate) [code=c++]#include<fstream> #include<iostream> #include<cstdio> using namespace std; int main(){ …

Member Avatar for mrnutty
0
375
Member Avatar for charmed14

So, I'm trying to create a Caesar Cipher using C++. It's supposed to be able to calculate the shift depending on what letter appears the most (which would mean that it's "e"). It's also supposed to have wrap around text, which I've tried to think of a way to have …

Member Avatar for VernonDozier
0
100
Member Avatar for jonyb222

Good evening Daniweb, I have another idiotic problem which comes from making an arrival subclass out of Event. I have a few other subclasses of Event and they aren't giving me any trouble. I have tried to copy/paste/rewrite to eliminate any stupid typos. Arrival.h:7: error: expected class-name before ‘{’ token …

Member Avatar for jonyb222
0
552
Member Avatar for cog_bn

Hi, I've got a problem with a program that boils down to strange behavior by the vector container class. It seems to not want to call constructors enough but calls destructors too many times: [CODE] #include <vector> #include <iostream> using std::cout; int constructor_count=1,destructor_count=1; class obj{public: obj(){ cout<<"C: "<<constructor_count++<<'\n'; } ~obj(){ …

Member Avatar for vijayan121
0
625
Member Avatar for greatunknown

What is the best way to add something to the nested vector of a multidimensional vector...I already have ints inside, lets say VECNAME[rowone][columntwo]...How can I add to columntwo???

Member Avatar for greatunknown
0
77
Member Avatar for programer411

Hi I am supposed to write that implements a simple version of the BucketSort algorithm the only problem is I have no clue what that is. Any tips and examples on this would be awesome Thanks

Member Avatar for programer411
0
149
Member Avatar for p.jeet

Hello, I am runing this program this works if I dont delete anything in destructor. If I use delete variable name in destructor then it creates problem. It creates problem when destrctor get called while operator ovrerloading. I think It is trying to delete the memory that has already been …

Member Avatar for p.jeet
0
91
Member Avatar for XiaO yuEn
Member Avatar for Ancient Dragon
0
68
Member Avatar for kavithabhaskar

Hello Folks: I had previously posted this problem and someone on this forum suggested that i used s[i] == 'a' || s[i] == 'A' .... but what I have here completely makes sense.. Can you please take a look at it ? [CODE] #include<iostream> #include<string> using namespace std; int main() …

Member Avatar for kavithabhaskar
0
90
Member Avatar for sexyzebra19

My program keeps crashing and I can't see why, if I remove the line [code=php] myfile << data_[i+ndim_*j] << " "; [/code] then it runs OK...but can't see anything wrong with this line? [code=php] void Matrix::WriteToFile(std::string fname) const { ofstream myfile; myfile.open ( (fname+".txt").c_str() ); for (int i = 0; …

Member Avatar for sexyzebra19
0
98
Member Avatar for sexyzebra19

My function is: [code=php] void Matrix::WriteToFile(std::string fname) const { ofstream myfile; myfile.open ("std::string fname.txt"); for (int i = 0; i<data_.size(); i++) myfile << data_[i] << " "; myfile.close(); } [/code] and then in the main I have A.WriteToFile("hello"), but it's saving it as fname still? Can anyone please tell me …

Member Avatar for sexyzebra19
0
218
Member Avatar for bigdog1

Write a program that will read in 10 test scores. Print out all 10 scores, then print the highest score, and then the lowest score. Ok i got this so far but i do not know how to print the highest or lowest. [code] #include<iostream> using namespace std; int main() …

Member Avatar for Nick Evan
0
258
Member Avatar for Anarionist

I wish there was an option in the "What are you posting" for tutorials hehe. But I guess I will just have to right it here :). If anyone else has any pointers (pun intended) let me know ;). Ok if your like me and were wondering how to accept …

Member Avatar for Nick Evan
-1
98
Member Avatar for pixelerator
Member Avatar for pixelerator
0
109
Member Avatar for smcp

Hey guys, I'm new to this whole programming deal and have browsed around these forums here or there to learn a few things. My latest assignment is to create a working tic tac toe game, including functions to initialize the game board, print the board, check the game status, checking …

Member Avatar for Salem
0
118
Member Avatar for jonyb222

Good afternoon Daniweb, I have a simple (and probably idiotic) problem today, I have a simplistic program that simulates a Train station, trains come in, they go into a stationDock and come out after a while. The stationDocks are an array of trains, either pointing to a train or being …

Member Avatar for jonyb222
0
3K
Member Avatar for digiguy

hello all; i'm having a problem with my output. the program that i'm writing is supposed to take a number input than display the output as asterisks. so if the input is 4 the output should be: * ** *** **** however, i'm just getting a single column of asterisks. …

Member Avatar for digiguy
0
87
Member Avatar for callister

Guys..Can anyone help me to explain what really happened in the while loop and both of the if else loop that makes this coding can find the root using bisection method.Thank you...[code]#include "stdafx.h" #include <iostream> #include <cmath> #include <iomanip> using namespace std; double f( double); int main ( int argc, …

Member Avatar for StuXYZ
1
124
Member Avatar for rwill357

I was wondering if there were away to repeat the same test multiple times and average the time. The code works fine [CODE] #include <cstdlib> #include <ctime> #include <iostream> using namespace std; void PrintArray(int* array, int n); void QuickSort(int* array, int start, int end); int partition(int* array, int pivot, int …

Member Avatar for niknailer
0
108
Member Avatar for KronicZ

Hey guys, I came here to ask for some help on making a DoS(Denial of Service) program, Not MS-DOS :p. My problem is I don't know what i would use to make it function. I don't know and can't find the functions I would use to make it. I was …

-3
91
Member Avatar for correaj

If anyone could give me a pointer here I would be grateful. I am making a public function that takes to container objects called bags and a file name in their arguments. I'm trying to create a loop that would extract the first line of doubles in a file and …

Member Avatar for correaj
0
857
Member Avatar for hey joe
Member Avatar for JTX

What's the simplest way to write a Prime Factorization program in C++? (A program that lists all prime factors of a number)

Member Avatar for NathanOliver
-1
73

The End.