15,300 Posted Topics

Member Avatar for Jenniferting

Your algorithm for that function is incorrect. According to [this article](http://en.wikipedia.org/wiki/Luhn_algorithm), you have to double every second digit. It's not clear from that function whether it is validating the account number or calculating a checkdigit. If you are validating the account number there is no need to calculate the checkdigit …

Member Avatar for Ancient Dragon
0
252
Member Avatar for ilian.bonov

which line? >cin>>c>>endl; Line 21: endl can not be used cin, it's only useful for outpout streams, not input streams.

Member Avatar for ilian.bonov
0
132
Member Avatar for a9602

depends on the operating system and compiler you are using. There is no standard way to change background color because that is a function of operating system.

Member Avatar for a9602
0
88
Member Avatar for john540

A complete reference is online at Microsoft's site MSDN (Microsoft Developer's Network). Just google for the name of the tool you want to know about. For example if you want to know about the editbox, then google for "msdn editbox" If you can spend some money then you can buy …

Member Avatar for Ancient Dragon
0
92
Member Avatar for STVG

1. use a char variable char filename[255]; getline(cin,filename); ifstream in(filename); 2. read each line of the file. When a line is read search it for the desired text. In c++ you can use std::string's find() method. 3. You have to completely rewrite the file, leaving out the line you want …

Member Avatar for Ancient Dragon
0
163
Member Avatar for Musa_Jutt
Member Avatar for Fuzzies

fgets() read the <Enter> key into the buffer if the buffer is large enough to hold it. It's done that way by design so that the program can tell whether all the line was read or not. If the '\n' exists at the end of the line then the entire …

Member Avatar for Ancient Dragon
0
225
Member Avatar for whileiforelse

line 81. After you enter a number and press <Enter> key, cin does not remove the enter key from the keyboard buffer. Then when getline() is executed at line 9 it sees '\n' in the keyboard buffer and removes it thinking that is the end of the text you just …

Member Avatar for whileiforelse
0
194
Member Avatar for firras

CreateList just copies the input file to the output file, it does not retain any of the data or create a linked list. The loop starting on line 146 will do nothing because myHead is NULL.

Member Avatar for Ancient Dragon
0
706
Member Avatar for bernaprog

what compiler are you using? I compiled/ran with vc++ 2008 express and your first program worked ok.

Member Avatar for Ancient Dragon
2
121
Member Avatar for Dani

Happy birthday Dani :) :) My score was 55 WPM. Oh well, I don't type as much as I did 20+ years ago.When I was 30 I was doing about 100 wpm.

Member Avatar for Mike Askew
6
761
Member Avatar for VergilDevil123

Corrected function. nevsor_t is NOT a structure, it's a typedef, so you don't use the struct keyword with it. Also, there is no \* before ia->age because ia is not a double pointer. int sort_age(const void *a, const void *b) { nevsor_t *ia = (nevsor_t *)a; nevsor_t *ib = (nevsor_t …

Member Avatar for Ancient Dragon
0
470
Member Avatar for nyfan68

Implementing the add() function is pretty simple, just assign one of the elements of aNames and aNumbers from the two parameters. For example: aNames[i] = name.getname(); Is class Phonebook right? The find() method is supposed to return a reference to PhoneNumber class, but PhoneNumber is not in Phonebook. I'm thinking …

Member Avatar for Schol-R-LEA
0
158
Member Avatar for salah_saleh

_A_FUNCTION is not the same as _A_FUNCTION(), read [this article](http://gcc.gnu.org/onlinedocs/cpp/Function_002dlike-Macros.html#Function_002dlike-Macros)

Member Avatar for Ancient Dragon
0
91
Member Avatar for jongiambi

lines 16-23 are incorrect. The loop also needs to check for end-of-list so that it doesn't attempt to iterate past the end of the list when item does not exist in the list. currPtr = head; while (currPtr->next != NULL && currPtr->next->datum != item) { currPtr = currPtr->next; } if( …

Member Avatar for Ancient Dragon
0
282
Member Avatar for Ancient Dragon
Member Avatar for mmathew

What's the question(s)? The code you posted doesn't even start to do the assignment. Hint: use fgets() instad of scanf() when you want to enter a string that contains spaces. For example: char name[255]; printf("Enter your first name, middle name, and last name\n"); fgets(name, sizeof(name), stdin); Another way to do …

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

There are several ways to correct the problem: add using std::cout after the includes and before any functions, or on line 6 use std::cout

Member Avatar for Everlight
0
3K
Member Avatar for spiderman.rapp
Member Avatar for nitin1
Member Avatar for kemcar
0
127
Member Avatar for yxBen

>First post here, please go easy on me :) Fat chance :) Move line 6 to line 3 so that it is not inside any function. Your program compiles without errors/warnings using VC++ 2012, as you already stated. It won't compile using Code::Blocks w/MinGW. I don't know enough about that …

Member Avatar for yxBen
0
676
Member Avatar for SphirosOkelli

You mean you want to put a function in the output file? Why? Can't be done. You don't put executable code in the output file. Instead, you write a function that reads the output file and do whatever you need to do with the data.

Member Avatar for SphirosOkelli
0
151
Member Avatar for dalawh

You mean Program A has a file open for reading, then Program B wants to write to that file? What I think you want is to synchronize two processes, see [these google links](https://www.google.com/#hl=en&tbo=d&sclient=psy-ab&q=synchronize+processes&oq=synchronize+processes&gs_l=hp.3..0l2j0i30l2.1904.7310.0.8734.21.11.0.10.10.0.96.801.11.11.0.les%3B..0.0...1c.1._GM4-GtdYBM&pbx=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=7bb9b384f427c1da&bpcl=38093640&biw=1487&bih=881)

Member Avatar for mike_2000_17
0
235
Member Avatar for coding101

My guess is that procfile_read() is writing beyond the bounds of buffer parameter. Is buffer allocated enough memory to hold all those lines of text? Also, the loop on line 21 should be <index, not <=index because the loop starts counting at 0 and the value of index is initially …

Member Avatar for Ancient Dragon
0
298
Member Avatar for Carc369

I think you are misunderstanding what that function is doing. It is only printing one word at a time, but it doesn't print a '\n' after each word. do this and each word should be on its own line. `cout << searchWords << '\n';`

Member Avatar for Ancient Dragon
0
227
Member Avatar for rithish

No they are not the same. Read [here](http://en.wikipedia.org/wiki/Adjacency_matrix) and [her](http://en.wikipedia.org/wiki/Incidence_matrix)e.

Member Avatar for deceptikon
0
181
Member Avatar for daino
Member Avatar for daino
0
137
Member Avatar for Ancient Dragon

I came across [this site](http://ynwlypmxhzyo.spotsoft.net/browse/search/?q=Microsoft+Visual+Studio) a little while ago tha is selling Microsoft Visual Studio for ridiculously low prices. Illegal copies or valid?

Member Avatar for <M/>
0
161
Member Avatar for izabella.pearson

line 52: FDOM hasn't been initialized to anything, so it just contains some random value. What compiler are you using? Learn to use your compiler's debugger so that you can easily find the mistakes in your program.

Member Avatar for Ancient Dragon
0
160
Member Avatar for Bowdown28

What version of Visual Studio are you using? M$ dropped support for c++ Windows Forms in VS 2012. textbox.Text = "something" will set the text in a textbox, read [this link ](http://msdn.microsoft.com/en-us/library/system.windows.forms.textbox_properties.aspx)for all properties/methods. So to make the calculation just convert the text in the textbox to an int, make …

Member Avatar for Ancient Dragon
0
341
Member Avatar for mahnaz0098

Which one, if any, of those you use will depend on how the cable is connected to the PC. Is it connected to LPT1, COM port, or USB? Most printers today are USB.

Member Avatar for Ancient Dragon
0
1K
Member Avatar for jude416

when you shuffle the questions do you also shuffle the answers at the same time, that is, when a swap is needed you have to swap elements in both arrays so that the two arrays remain in the same order. Oh well, I just answered a dead thread :)

Member Avatar for DeanMSands3
0
283
Member Avatar for muhammad.khan.3576

Your function total() is incomplete. After declaring section c you need to populate its members with totals from a + b then you can calculate the sum as you have coded it. The sum can't be calculated until no_boys and no_girls are known.

Member Avatar for Ancient Dragon
0
280
Member Avatar for loldafuq

>I know only rand and srand but how to display these lucky/happy numbers and how to store 6dight numbers i array? Simple: just an assignment statement. Below is an example. int numbers[20]; for(int i = 0; i < 20; i++) numbers[i] = rand(); // now to display them for(int i …

Member Avatar for laura90
0
218
Member Avatar for HunainHafeez

Does that also happen with other web sites? What country do you live in? Do you have an antivirus program always running? How much memory does your computer have? Does your computer have enough free hard drive space?

Member Avatar for HunainHafeez
0
286
Member Avatar for manjushcool

It doesn't look like the file has been read at that point. main() just opens the file but doesn't read it into the patient and hospital arrays.

Member Avatar for happygeek
0
4K
Member Avatar for nyfan68

>how to check if the name is in between 1 and 25 characters. I know I need to use the >, <, || operators, but I can't remember how to compare a string. Any he Just use std::string's length() method to find out how many characters are in the string. …

Member Avatar for nyfan68
0
159
Member Avatar for Vish0203

Just take the original file name and append something to it std::string name = "Hello"; std::string newname = name + "There"; ofstream out(newname.c_str()); Or, if you want to keep the same name just put the new file(s) in a different folder by appending the new path to the folder to …

Member Avatar for Vish0203
0
132
Member Avatar for shorty001

Maybe [URL="http://msdn2.microsoft.com/en-us/library/ms235630(VS.80).aspx"]these short tutorials[/URL] will help

Member Avatar for ps- india
-1
2K
Member Avatar for thammalatha

>how we protect our files from others to modify them through programming You can't on MS-Windows. About the best you can do is encrypt the files, then when your program need to change the file decript it again. If you are running a version of MS-Windows that has NTFS file …

Member Avatar for thammalatha
0
142
Member Avatar for allis0

Couldn't you buy it locally, on DVD? I have no idea what you can do other than what you have already done. My recommendation: stick with Windows 7, do not upgrade to Windows 8. I upgraded and now regret it becuse all the data on my hard drive is now …

Member Avatar for caperjack
0
210
Member Avatar for cutterpillow20

[QUOTE=cutterpillow20;1760561]Thank You for tha Information sir... but my problem that i can move/manipulate the cursor left, right, down, up in the output screen. Hope you can help me...[/QUOTE] He already told you how -- call gotoxy().

Member Avatar for Ancient Dragon
0
1K
Member Avatar for LastMitch
Member Avatar for seeking_help

you can do it in C, C++ or vb.net, use which ever language you already know and is able to call C language functions (which is most languages I know of). A more relevant question might be what gui libraries do you want to use. In c++ you could use …

Member Avatar for Ancient Dragon
0
176
Member Avatar for cynfudi

You need to initialize the array count_let to all 0's before calling that loop. You can do that when it is declared, like this: `int count_let[20] = {0};` Since you are reading the file one character at a time it is not necessary to read the characters into an array. …

Member Avatar for cynfudi
0
133
Member Avatar for jamd200

You could use this [URL="http://www.pdftoword.com/"]PDF to Word converter program.[/URL]

Member Avatar for zarfishan
0
2K
Member Avatar for sarah.mathieson.7

The way I have done this in the past is to put a linked list of Citizens inside the District structure, something like below. Note that unless you were instructed to do otherwise you don't need both a CitizenNode and a Citizen structure, just one or the other. struct Citizen …

Member Avatar for Ancient Dragon
0
203
Member Avatar for Transcendent

get [MinGW](http://sourceforge.net/projects/mingw/files/), but I don't know which version of gcc it uses.

Member Avatar for mike_2000_17
0
1K
Member Avatar for Carc369

Can you only enter alph characters such as 'a' to 'z', no caps or other special characters? >for(int value = 0; value < strlen(userInput); value++) calling strlen() in a loop like that is poor programming practice because the return value never changes and its time consuming. Here is a better …

Member Avatar for Carc369
0
161
Member Avatar for petzoldt01

>LadderLogic is rightfully a language in itself. Yes, I agree with that, I used to work for a company that installed large character printers and scanners on production lines in factories. Devices that used LadderLogic language were often used to bridge the gap between computer and production line hardware, such …

Member Avatar for Dani
0
173

The End.