51,593 Topics

Member Avatar for
Member Avatar for mrmodest34

Alright, I understand some of the basics of big O notation, but I have a test coming up in a few days and I need a bit of help. I understand that if you have a loop that iterates i*=2 then it would run lg(n+1) as log base 2 and …

Member Avatar for histrungalot
0
210
Member Avatar for P3rryD

HI, I recently joined the forums (today) and i would officially like to say hi. [COLOR="Green"]HI[/COLOR] For my question: [COLOR="Red"][B]Are there any books,websites or tutorials that use a moderate vocabulary that teach C++?[/B][/COLOR] Thanks for the help in advance. BTW is there a rules page? _______________________________ Bye

Member Avatar for WaltP
0
177
Member Avatar for toyotatundra

this runs but with unexpected results,why?I insist on using cin.getline and I was hoping if statement will execute, however the else statement is da one dat executes. As for the question I think the first answer is correct char name[256]; cout <<"enter name"<<endl; cin.getline(name, 256); if (name == "My boy") …

Member Avatar for NathanOliver
0
124
Member Avatar for mrcerimo

I'm trying to make encryption program but when i run the program it gives me this error: Debug Assertion Failed! Program:...nts\visual studio 2010\projects\encrypter\debug\encrypter.exe File:c:\program files\microsoft visual studio 10.0\vc\include\xstring Line:1441 Expression: string subscript out of range For information on how your program can cause assertion failure, see the Visual C++ documentation …

Member Avatar for mrcerimo
0
310
Member Avatar for ashsha

From A C++ beginner. I have written a class that splits the first list into 2.I used iterators to accomplish it. Now I am supposed to create a new method that splits the input chain ∗this, destroys the input chain and uses its nodes to construct the chains a and …

Member Avatar for ashsha
0
182
Member Avatar for ads1188

Hi all, I have 2 forms, form1 is for entering Name, ID and School. I want all the data i enter in form1 to show in a table in form2. Can someone recommend which way is best of doing this? Many Thanks

Member Avatar for Ancient Dragon
0
106
Member Avatar for Z33shan

hello :) i'm using MFC SDI, & i'm less familiar to it. i need to know, 1: i have found a way of printing a string as [CODE]pDC->DrawText( " Task still pending!!! ", &rect , DT_PATH_ELLIPSIS );[/CODE] but i want to know, how can i print a 2D-Array in MFC …

Member Avatar for Ancient Dragon
0
396
Member Avatar for sudheer2250

Hi All, I am trying to convert the following C++ code to C#. pExportDir = (PIMAGE_EXPORT_DIRECTORY)GetPtrFromRVA(exportsStartRVA, pNTHeader, pImageBase); [CODE]template <class T> LPVOID GetPtrFromRVA( DWORD rva, T* pNTHeader, PBYTE imageBase ) // 'T' = PIMAGE_NT_HEADERS { PIMAGE_SECTION_HEADER pSectionHdr; INT delta; INT delta2; pSectionHdr = GetEnclosingSectionHeader( rva, pNTHeader ); if ( !pSectionHdr …

Member Avatar for sudheer2250
0
456
Member Avatar for maxmeier

Hi all, I want to store the result of a SQL query into some kind of container. Typically, a result consists of several columns, each of which has different types - depending on the query. E.g., 'select productname, price, stock_count from...' leads to 3 result columns: char, float and int. …

Member Avatar for maxmeier
0
147
Member Avatar for rickenjus

[b]I want this code to call generic catch block whenever any special character(eg. !,@,#,$,%,&,*, etc) is enetered in numerator or denominator. So what code should I add to this. Any help would be appreciated. Thanks. [/b] [code=c] #include <iostream> using namespace std; int main() { try // generic catch block …

Member Avatar for thines01
0
376
Member Avatar for Labdabeta

I am getting ready to write a programming competition on Tuesday (the Canadian Computing Competition) and I remember that last year it said that only standard libraries can be used. I was having trouble deciding which libraries are standard. I ended up using windows.h and when I suddenly realized that …

Member Avatar for Labdabeta
0
192
Member Avatar for delgadough

Hey all, I am working on my first C++ prog and I'm having an issue on my output. I compiled the code ok but when i try to execute, the output comes up with weird numbers and letters where it is supposed to display the "photos in"[CODE]// Name: Danny Delgado …

Member Avatar for delgadough
0
114
Member Avatar for MrEARTHSHAcKER

Hi, I am learning templates so I have one question for this code: [CODE]template<typename T, int Number> class Data{ T Array[Number]; public: T& operator[](int); }; template <typename T,int Number> T& Data<T,Number>::operator[](int element){ return Array[element]; }[/CODE] I wish to create specialization for that class template, for any random data type, but …

Member Avatar for MrEARTHSHAcKER
0
924
Member Avatar for mfcdoubt

I have following header file defines test2.h ----------> header file template<class T> class temp2 { public: temp2(); virtual ~temp2(); }; test1.h ----------> header file template<class T> class temp1 { public: temp1(temp2<T> (temp2<T> *temp2ptr); ~temp1(temp2<T> (); protected: temp2<T> *tempptr; }; test3.h -------------> header file class test3 { public: test3(); virtual ~test3(); …

Member Avatar for huda_7978
0
3K
Member Avatar for ads1188

Hi all, I am new to programming and having been experimenting various codes recently. I have managed to link 2 form so that when i click a button on Form1, Form2 opens. I am using the code [CODE]Form2^open2 = gcnew Form2(); open2->Show();[/CODE] This codes work fine. Is there a way …

Member Avatar for ads1188
0
113
Member Avatar for infamous1987

One way to measure the amount of energy that is expended during exercise is to use metabolic equivalents (MET). Here are some METS for various activities; Running 6 MPH: 10 METS Basketball: 8 METS Sleeping: MET The number of calories burned per minute may be estimated using the formula Calories/Minute= …

Member Avatar for Software guy
0
1K
Member Avatar for Kanoisa

Hi all, I have started finding lots of uses for abstract classes to define interfaces for common functionality using polymorphism and i know that using polymorphism and virtual functions incurrs some additional call cost of functions. So what im wondering is can i get the best of both worlds? consider …

Member Avatar for Kanoisa
0
198
Member Avatar for Awah Mohamed

Hi guys, how are you? Well, i have my science fair soon and i want to build a software that can copy any given file to any removable device that gets connected to the computer it is running on.. But the problem is i dont know how to do this... …

Member Avatar for BobS0327
0
998
Member Avatar for Z33shan

hello :) i've Two questions to ask. i'm working on MFC SDI, i'm less familiar to MFC. i found that a way to print a string in MFC SDI is: [CODE]pDC->DrawText( " mc Test Ellipse ", &rect , DT_PATH_ELLIPSIS );[/CODE] but i have to print a 2D array in MFC …

0
127
Member Avatar for nuclear

I'm trying to use Box2D lib with SDL lib. NOTE that I only get the errors below after I link in SDL too. I think i link everything accordingly but in the end when I write up some code i get errors like: 1>------ Build started: Project: box2d test2, Configuration: …

Member Avatar for Ab000dy_85
0
546
Member Avatar for rutwvu

I am currently working on implementing an operating system in turbo c which uses c as the programming language. For this project we must implement pagination. I have absolutely no idea how to do this in c and most web results are for web pages using mySQL or java or …

Member Avatar for rubberman
0
207
Member Avatar for Suzie999

Hi all, hope you are well. I'm having some trouble trying to convert the literal value of a hex number to int. I say literal but I'm not sure if that is the correct term, but my code will explain better I hope. I have simplified the code down to …

Member Avatar for Moschops
0
433
Member Avatar for nine9hours

Hi. I have made a simple testing program which I'll use in another program later. I create the items of the QListWidget through looping and now I want to make changes in one of the items of the list, which the user clicks. But when I call a fucntion to …

Member Avatar for nine9hours
0
996
Member Avatar for SAM2012

I am new to this forum. I need help in defining the same kind of function according to my requirements. as [url]http://www.codeproject.com/Articles/1088/Wildcard-string-compare-globbing[/url] I hope, I 'll get good response. Words are strings which are separated by dots. Two additional characters are also valid i.e:The *, which matches 1 word and …

Member Avatar for deceptikon
0
202
Member Avatar for mkaynutty

So basically this is suppose to be a grade calculator and the program works, I now just have to put it into a do-while loop so it can work for more than one student. My professor wants it to say Y for another student and N to quit at the …

Member Avatar for doma18
0
202
Member Avatar for doma18

[CODE] #include <iostream> #include <string.h> #include <ctype.h> using namespace std; int main() { system("Color 1A"); char clear[200]; char cipher[200]; int x,i; cout << "what do you want to do with your password " << endl; cout << "1 Encrypt your password " << endl; cout << "2 Decrypt your password …

Member Avatar for doma18
0
884
Member Avatar for yongj

So I have a file that has contents that need to be stored into a growing object. By growing I mean that it'll explicitly concatenate the new line it reads into the growing object, pBuff, each time every line is read from the file. I only get the last line …

Member Avatar for histrungalot
0
282
Member Avatar for nuclear

[B]On visual studio 10:[/B] I've tryed out some code and everything was fine, but when I use this line: [CODE]sf::RenderWindow App( sf::VideoMode ( 800, 600, 32 ), "Hexagon Puzzle Thing" );[/CODE] Or anything with RenderWindow I get an: Unhandled exception at 0x76adfeb8 in SFML + Box2D Project.exe: 0xC0000005: Access violation …

0
91
Member Avatar for wildplace

[CODE]struct Information { ifstream* in; ofstream* out; ... }; ..... ((*info).in)->eof() //this one (*(*info).in).eof() // and this one[/CODE] so, info is a Information struct, is there any different between the two shown above? my guess is they are the same. and what is "->" and "." called?

Member Avatar for ejosiah
0
126
Member Avatar for sujan.dasmahapa

I have created a toolbar in mfc. I want to add this toolbar on my dialog. So in the dialog's OnInitDialog() function I am trying to create this toolbar. But the toolbar is not coming. Please tell me how can create it. [code] BOOL CDlgsViewDlg::OnInitDialog() { CDialog::OnInitDialog(); CToolBar toolBar; CRect …

0
69
Member Avatar for jonnyboy12

Hello all this is my c++ web server that i can get working on my computer but not connecting to others for some reason. I am not on a router, just using my external ip address. If i run the server and type my external ip address into my browser …

Member Avatar for jonnyboy12
0
215
Member Avatar for SamuraiGhost

I have code that will ask for the day of the week but is there a way to make it ask the question again if the user doesn't enter one of the 7 days provided? [CODE]string TheDay() { string whichday; cout<<"Please provide a day of the week - ex. Mo …

Member Avatar for livinFuture
0
81
Member Avatar for newbie1234

i want to read data from file. I have test.txt. In this i have data a:123 b:223 c:323 how can search 'b' and get the data 223 and so. I found some where that i can go via getline and than tell and for data grabing seek. but i do …

Member Avatar for tungnk1993
0
267
Member Avatar for stevo7624

Can someone help me finish this code off. Its a simple program that prompts two players to pick a card. Each picks between 0-51. An array is holding each of the cards by rank and suit using a struct. Everything works great except the greater_than function. The only issue with …

Member Avatar for stevo7624
0
128
Member Avatar for ejohns85

Hello, I am trying to capture a video stream from a webcam, and simultaneously display the frames, using OpenCV. Previously, I have captured one image, and then at the end of my program displayed the image in a window, which works fine. However, when I try to capture a sequence …

Member Avatar for josephbeluan
0
498
Member Avatar for aderogba08

I wrote a program that allow users input a double value, if I input a string or a char value, it turns out to be a logical error. I've tried this: [code=c++]bool h; float value; do{ cout<<"enter a value"<<endl; cin>>value; if(cin.fail()){ cout<<"error, enter a value!"<<endl; cin.clear(); cin.ignore(); h=true;} else h=false; …

Member Avatar for aderogba08
0
227
Member Avatar for shywolf91

Here is the Full assignment and what I have done so-far: [B](1) The program will ask the user to enter a filename from the console. (Just like the last assignment). (2) The initial configuration will be read in from a file, which will be a 12 by 30 two-dimensional array …

0
78
Member Avatar for Guipborges

I am migrating my code from the builder 6 to embarcadeiro xe2 c++. The files.Cpp are constructed separately without problems, however when I build all comes the following error message-> [ILINK32 Error] Fatal: Unable to open file 'TYPINFO.LIB' FAILED! And the process ends! Can anyone help me?

Member Avatar for Banfa
0
99
Member Avatar for pattmorter

a friend asked me to help him with his lab. the lab involves opening a file and adding the numbers in the file together displaying how many even and how many odd numbers there are. I have the file "textinput.txt" in the directory with the .cpp file but when i …

Member Avatar for pattmorter
0
305
Member Avatar for ChevyScience

I am having a problem with my code, it is suppose to be rearranging the characters inside the array, but every time i enter the lower bounds (x) and upper bounds (y), i rearranges the wrong alphabets. Here is my code [CODE] int main() { char a[5]={'A','B','C','D','E'}; int x, y; …

Member Avatar for ravenous
0
172
Member Avatar for Labdabeta

To what extent does the system endianness effect a program. I know that doing pointer assignment will be affected, and unions are too, but what about bitshift operators? Do they apply to the value, merely emulating real bitshifts, or do they apply to the bits themselves? Are there any other …

Member Avatar for Labdabeta
0
89
Member Avatar for nonlinearly

Hi I have an old inherited file with c code (visual studio 6). I compiled this file in Visual C++ 2010 (I made an empty project and a win32 console application) and was OK. But when I did the build to make the .exe then the linker throws errors. I …

Member Avatar for nonlinearly
0
249
Member Avatar for virus.exe

I was wondering if it is possible to move the mouse in C++. Like get the coordinates and move the cursor. Maybe it's not possible but it would be cool. thx

Member Avatar for BhawikJain
0
395
Member Avatar for matt209

I'm new to using vectors and some may see this as a trivial problem. If you have any suggestion on how I can improve the program, I welcome your input. code(with problem): [CODE] #ifndef CMONOPOLY_HPP #define CMONOPOLY_HPP #include <vector> #include "head.hpp" namespace CMonopoly { class CMonopoly { public: ~CMonopoly(); void …

Member Avatar for matt209
0
667
Member Avatar for shadow29014

I created a program which outputs a y coordinate based on a value of an x. Here is my code. [code] double xmax,xmin,xspac; cout << " Input a value of minimum value for x: " << endl; cin >> xmin; cout << " Input a value of maximum value for …

Member Avatar for tungnk1993
0
117
Member Avatar for CreativeCoding

So I am sorta interested in viruses. No, I do not plan to make the next conficker or even something that will trash my brothers PC. But I want to learn about how they work. What they do that makes PC's let them into their system... So for a first, …

Member Avatar for Pestilence
-2
183
Member Avatar for grh1107

how you would compute/denote the time complexity of two loops based on different variables? I understand how to compute the time complexity for a simple loop PseduoCode while X<N { while Y<M { Z++ } X++ } one loop occurs N times - time complexity O(N) the other loop occurs …

Member Avatar for mrnutty
0
315
Member Avatar for Susmita_Sikder

hi all, i can't do the programme in c++ "Write a scanf function in c which accept sentence from user."pls any body reply. thank you in advance

Member Avatar for tungnk1993
0
322
Member Avatar for Candace Parker

Hello everyone! I have here a code with a random-access file that lets you delete and update any information in the file. Please run the file to see what I'm talking about. [CODE] #include <iostream> #include <fstream> #include <iomanip> #include <string> using namespace std; #include <cstdlib> int choice; void displaysmenu(void) …

Member Avatar for Moschops
0
3K
Member Avatar for Dec28

Alright guys, I've been trying to think how to do this and I keep confusing myself. It's part of a project using piping in UNIX but first I need to get this small program running properly. I want to pass the final result (Hex value) to another program that will …

Member Avatar for histrungalot
0
247

The End.