15,300 Posted Topics

Member Avatar for zee93

If user enters wrong data then display an appropriate error message then re-display the original question. Best way to do that is to put all that in a loop and break out of the loop only when user enters correct data.

Member Avatar for deceptikon
0
3K
Member Avatar for montjoile

Send me a copy of the program and I'll test it on my computer. Might be a problem with the pc you're trying to use.

Member Avatar for WaltP
0
196
Member Avatar for ruval002

You can't use cin >> for strings that may contain spaces because cin will stop at the first white space (spaces and tabs) character. If you want white space in the string then use getline()

Member Avatar for Ancient Dragon
0
192
Member Avatar for ilearnz001
Member Avatar for deceptikon
0
113
Member Avatar for gabriellogan

class constructors are private, so you will not be able to use that class for anything. The second constructor is setting a pointer to some other object -- a very very bad idea because when the other object is destroyed the pointer in MyClass will become invalid. You need to …

Member Avatar for gabriellogan
0
140
Member Avatar for kikic

There are lots of sort algorithms -- google for "bubble sort", which is the easiest one to write. Or you could use cl++ std::sort function. [code] #include <string> #include <algorithm> int main() { std::string s = "acefd"; std::sort(s.begin(),s.end()); ] [/code]

Member Avatar for Bench
0
260
Member Avatar for senergy

+= is ok there because he's using std::string Your program probably needs to check for sql errors on return because it could be some other problem, such as not logged into mysql.

Member Avatar for senergy
0
111
Member Avatar for suneye

What operating system and compiler? What GUI platform (e.g. win32 api, MFC, Windows Forms, wxWindows, etc)

Member Avatar for Ancient Dragon
0
152
Member Avatar for picogenkaku

The timer is set to run for about 90 secndxs. Why do you think it should run until 1:30 ? >>if(seconds == 90) Impossible. The loop will stop as soon as seconds == 90, so the statement above will never get executed.

Member Avatar for picogenkaku
0
240
Member Avatar for phorce

>>I'm trying to display the contents of a matrix without using "cout" in my class Huh?? How do you plan to display something without using either cout or printf()? one way to accomplish that in MS-Windows is to call [URL="http://msdn.microsoft.com/en-us/library/windows/desktop/aa365747(v=vs.85).aspx"]WriteFile[/URL]() instead of cout.

Member Avatar for ravenous
0
118
Member Avatar for Dhananjay_1976

You need to first get the current date from the computer's clock. Use the functions in time.h, time() returns the date/time in seconds, then call localtime() to covert that into a struct tm. Next convert user's birth date into month, day and year integers, then just subtract from struct tm. …

Member Avatar for Ancient Dragon
0
74
Member Avatar for skannigan

or [code] while( in_stream >> name >> combo >> op1 >> op2 >> op3 >> op4) { // do something with the data } [/code]

Member Avatar for Ancient Dragon
0
212
Member Avatar for triumphost

Visual Studio most certainly does contain a c++ compiler. You can get vc++ 2010 Express for free, as well as vb.net and C#. It's the best compiler suite there is for .net framework, afterall it is produced by the same company that wrote .net -- Microsoft. You can't get a …

Member Avatar for thines01
0
446
Member Avatar for kimbokasteniv

why not just make the array of pointers (note that arrays of references are illegal). [code] ReceiptBag zero("zero"); ReceiptBag one("one"); ReceiptBag * bags[] = {&zero, &one}; [/code]

Member Avatar for kimbokasteniv
0
301
Member Avatar for irre

If you surround the name of the include file with quotes the compiler will expect to find it in the current working directory (where the .c or *.cpp files are found). >>libCNum.a VC++ 2010 may not recognize that file format. They usually have *.lib extension.

Member Avatar for Ancient Dragon
0
184
Member Avatar for phorce

Do you want to know how to write a 1d matrix out to that file or read the file into the 1d matrix?

Member Avatar for WaltP
0
236
Member Avatar for Labdabeta

It's not all that difficult to do. Here's an example of push_back [code] const int BlockSize = 10; // allocate this number of elements at one time int MaxArraySize = 0; // initial size of the array int CurrentSize = 0; // current number of elements used in the array …

Member Avatar for Ancient Dragon
0
179
Member Avatar for Vasthor

Don't worry -- what you are experiencing is a common problem; forgetting. Keep on practicing as often as you can and you will eventually be able to remember it. Its very similar to learning to play a musical instrument; it takes lots and lots of practice. If you forget what …

Member Avatar for thines01
0
143
Member Avatar for ecin

use wcout [code] #include <iostream> using namespace std; int main() { wchar_t buf[] = L"Hello World"; wcout << buf << L"\n"; } [/code]

Member Avatar for jackwu
0
4K
Member Avatar for happygeek

We have fee wifi in a lot of places arond here -- gas stations, hospitals, McDonalds, and other businesses. These places even have signs on their buildings -- "Free Wifi". I agree with Grumpy, the judge should dismiss the case because free wifi has nothing to do with piracy. That's …

Member Avatar for WebCopywriter
1
907
Member Avatar for samidha

Its not "a company" but many companies/volunteer programmers with many different distributions of the operating system. One way they make money is on programming support.

Member Avatar for jbennet
0
156
Member Avatar for arubajam

No. The type between < and > in vector must be a data type, not the name of a variable. vowels is not a datatype.

Member Avatar for subith86
0
181
Member Avatar for Moirke

Compile for debug mode then single step through the program so that you can see where the problem is. How to do that will depend on the compiler you are using. >>vector<int>* readDice(vector<string>& anImage) { That function is attempting to return a pointer to local variable. And, like all local …

Member Avatar for Ancient Dragon
0
283
Member Avatar for tomtetlaw
Member Avatar for hkhk106

There are none for him at this time. Tell him to wait a few more years to grow up a little and finish grade school. There are a lot of necessary things he probably doesn't know yet, such as a good foundation in algebra. In the meantime he should be …

Member Avatar for sumtaru
0
241
Member Avatar for Loafer

do you know how to write a for loop? If not, then [URL="http://www.cplusplus.com/doc/tutorial/control/"]here is a tutorial[/URL]

Member Avatar for WaltP
-5
152
Member Avatar for ruval002

>>is there a way i can implement my insert function so that everytime it inserts a number it inserts it on the correct place Of course there is. Just start at the beginning of the list and check each node for a value that is either < or > the …

Member Avatar for Ancient Dragon
0
132
Member Avatar for alastair1008

LPCWSTR is a pointer to TCHAR so just use the & address operator to make the conversion `TextOut (hdc, 40,40,&chCharCode, 1);`

Member Avatar for Ancient Dragon
0
272
Member Avatar for sergent

I'm exclusively Windows 7 and use either Code::Blocks or VC++ 2010 Express. Of course I don't do professional coding any more so I am free to use whatever I want instead of what some employer forces down my throat.

Member Avatar for hystaspes
0
331
Member Avatar for onew1ng3d
Member Avatar for juss2022
Member Avatar for KRUX17

To append data to the existing file you have to add another parameter to the open() statement [icode]myfile.open ("Sold Tickets.txt",ios::app);[/icode] See the options in [URL="http://www.cplusplus.com/reference/iostream/fstream/open/"]this link[/URL]

Member Avatar for KRUX17
0
169
Member Avatar for rfrapp

Are you allowed to use standard C functions? sprintf() can do all that for you, just a matter of giving it the correct forma spcification. E.g. "%x" converts to hex and "%f" to float

Member Avatar for rfrapp
0
3K
Member Avatar for Nevicar

The first function is incorrect [code] void print (string word) { cout << word << '\n'; // display the string } [/code] Now do similar for second function, but this time put cout statement inside a loop.

Member Avatar for zeroliken
0
144
Member Avatar for Panathinaikos22

If you are wanting to learn win32 api, then [URL="http://winprog.org/tutorial/"]this[/URL] is a good introduction. But it is far easier to use a different language, such as C# or CLI/C++ (Windows Forms)

Member Avatar for jbennet
0
352
Member Avatar for subrata_ushasi

Why do you think CB doesn't support DirectX? or graphics? Have you read any of [URL="http://www.google.com/#sclient=psy-ab&hl=en&source=hp&q=directx+tutorial+c%2B%2B&pbx=1&oq=direcgtx+tuto&aq=1l&aqi=g-l4&aql=&gs_sm=1&gs_upl=7245l8566l1l11395l2l0l2l0l0l0l0l0ll2l0&bav=on.2,or.r_gc.r_pw.,cf.osb&fp=c3fe1decc135fe9e&biw=1647&bih=909"]these[/URL] tutorials?

Member Avatar for jbennet
0
263
Member Avatar for frogboy77

Up or down voting a post anonymously doesn't affect the person's rep points. All it does is show whether or not you liked the post, nothing more. That is not the same as the question you posed in the poll.

Member Avatar for zeroliken
0
104
Member Avatar for triumphost

NULL is defined differently in c++ -- its defined as 0, while in C its defined as (void*)0. '\0' is the same as 0. I never use NULL for anything other than initializing pointers.

Member Avatar for mrnutty
0
234
Member Avatar for vic s

You need to use an array of ints, one for each task. Or if you know there will be only 4 tasks then you can use 4 different int counters [code] int count1 = 0, count2 = 0, count3= 0; int main(){ int option =0; bool exit = false; while(!exit) …

Member Avatar for Labdabeta
0
153
Member Avatar for lupacarjie

It might simplify the program if you write two more functions: 1) a function that inserts a new node into the list in its correct position, and 2) a function that displays all the nodes in the list. Then main() can contain a simple loop [code] void InsertNode(node**head, node*p) { …

Member Avatar for lupacarjie
0
300
Member Avatar for fsemilla

Did you find [URL="http://www.zigbee.org/en/spec_download/zigbee_downloads.asp"]this[/URL] ?

Member Avatar for agieli
1
2K
Member Avatar for passionated

>>why it is assigned i=1 That's called initializing a variable to some known value. The value 1 was arbitrary, would have been any number. The important point is that the value is something that the author knows. Programmers would normally initialize variables to 0. >>why it has given i<=10 So …

Member Avatar for JilMakias
0
185
Member Avatar for zekstein

Learn socket programming. How to do that will depend on the operating system you are using. If *nix you need [URL="http://www.linuxhowtos.org/C_C++/socket.htm"]POSIX sockets[/URL]. MS-Windows use [URL="http://johnnie.jerrata.com/winsocktutorial/"]WinSocket[/URL].

Member Avatar for thines01
0
415
Member Avatar for drewangel

Your compiler does not support threads. You will have to use a modern compiler such as Code::Blocks or VC++ 2008 Express, both are free for the downloading.

Member Avatar for DeanMSands3
0
732
Member Avatar for ddm

[URL="http://www.daniweb.com/software-development/cpp/threads/6542"]Here[/URL] is a short tutorial

Member Avatar for Ancient Dragon
0
67
Member Avatar for badboy11

>>It seems like Visual Studio 2010 compiler is complaining that despite all classes are in the same namespace, the abstract class's pure abstract method is not implemented. I think you mis-interpreted the error message -- see comment below. This works ok for me using vc++ 2010 express. The only change …

Member Avatar for badboy11
0
257
Member Avatar for jatinkhandelwal

[QUOTE=jatinkhandelwal;1751825]i want something like this i want to search a file for various data types and print the sizes of them acordingly[/QUOTE] Post some examples of what will be in the file so that we don't have go guess that you want.

Member Avatar for Ancient Dragon
0
124
Member Avatar for sagarnarasgonde

How to do that all depends on the compiler and/or IDE you are using. Basically, a library is nothing more than a collection of compiled functions that are in a file with *.lib or *.a file name. *nix computers also have something called shared libraries, which has a *.so file …

Member Avatar for Moschops
0
168
Member Avatar for kmlila

The only way to find out how many times you executed the program is to write a value to a file or the registry. Programs can not retain values from one instance to another.

Member Avatar for kmlila
0
133
Member Avatar for CertifiedMan

>>There are some certifications that are nice to have and others that are simply "must haves" in today's competitive job market. Certifications only help you get a job. Two people with identical education and experience, the one with certs will probably get hired. None of the are needed for entry …

Member Avatar for peter_budo
-1
181

The End.