15,300 Posted Topics

Member Avatar for Rahul47

Some compilers let you select the padding size, or no padding at all regardless of what the members of the structure consist of. If I'm writing a program to transfer structures to another system then I use no padding. The problem with that is accessing members may be a little …

Member Avatar for ddanbe
0
214
Member Avatar for Ancient Dragon

I'm running 64-bit Windows 8.1 on a PC with 16 Gig RAM and 8 cores. I've noticed a lot of lag, e.g. all action momentarily stops and when it starts back up the game character quickly speeds across the screen. At other times when I join a multi-user session where …

Member Avatar for jwenting
0
200
Member Avatar for Dri Tan
Member Avatar for Ancient Dragon
0
56
Member Avatar for georgecalvin12

We have [Starbuks ](http://www.starbucks.com/?gclid=CKzko9LWwrwCFe1aMgodnG0A1Q)around here -- good product but much overpriced. I like Hills Bros double mocha cappuccino that I make at home.

Member Avatar for happygeek
-1
150
Member Avatar for ifeanyiben
Re: c++

[click this link](http://lmgtfy.com/?q=c%2B%2B+video+tutorial)

Member Avatar for Ancient Dragon
0
73
Member Avatar for mixelplik

You need to pass Number to assign() by reference, not by value so that assign() can change the structure that is declared in main().

Member Avatar for mixelplik
0
99
Member Avatar for totalwar235

Move lines 3 and 4 down after that first if statement, between lines 10 and 11. If master is null (line 10) then line 4 will cause a seg fault. In order to delete a node you have to keep track of the most recently visited node. ALLOCPTR* current = …

Member Avatar for Ancient Dragon
0
163
Member Avatar for brandon66

Open std::ifstream for input int item_numnber[3]; float item_prices[3]; int item_qry[3]; In a loop, use ifstream's >> operator to read each field into it's array element.

Member Avatar for cgeier
0
317
Member Avatar for willyah

why would you want to do that with threading?? I don't see how threading would help solve the problem, except maybe for huge values of N. In that case you could split the problem up, create threads that calculate individual chuncks of data. For example, if N is 1 Million …

Member Avatar for Ancient Dragon
0
187
Member Avatar for RLS0812

There are several old MS-DOS games I would like to see ported, regardless of price. [Eye of the Beholder](http://en.wikipedia.org/wiki/Eye_of_the_Beholder_(video_game)) is just one of them. That was a very fun game.

Member Avatar for jwenting
0
225
Member Avatar for sirlink99
Member Avatar for radu.nuconteaza

>#include "coduri functie.c" Never, ever, for any reason include one \*.c file in another. If your program uses more than one \*.c file then compile each one separately and link them both together along with any libraries to create the final executable file. How to do that depends on the …

Member Avatar for Ancient Dragon
0
239
Member Avatar for ismet_1

ODBC -- [see this tutorial](https://www.google.com/#q=odbc+tutorial+c%2B%2B). If you use one of the Microsoft compilers when you can also use ADO.NET

Member Avatar for ismet_1
0
101
Member Avatar for udaya.kiran.969

[Here](http://www.cplusplus.com/reference/ctime/) is a complete list of the available time functions. When to use what all depends on what you want to do.

Member Avatar for mike_2000_17
0
60
Member Avatar for bogoreh

delete line 30, it's already reading the file in line 27. Post the function that writes the file. A lot easier way to do it is to read/write binary files instead of text files using fwrite() and fread(). You write the entire structure as one chunk that way. But don't …

Member Avatar for bogoreh
0
189
Member Avatar for glamiex

The program is doing integer division which means no fractions because number1 and number2 are both integers. You can correct the problem by typcasting either the numerator or demoninator to float `correctanswer = (float)number1 / number2;`

Member Avatar for rubberman
1
160
Member Avatar for theashman88

>How can I find the executable file You could just use File Explorer, enter the program name in the search bar, and let File Explorer find it for you.

Member Avatar for Ancient Dragon
0
167
Member Avatar for Kartike

No one here is going to write your program for you. Here are some basic steps needed to complete your assignment. Step 1: create a structure that contains all the information you need to store in the file. Step 2: populate the structure with the data Step 3: using std::ofstream …

Member Avatar for Ancient Dragon
0
526
Member Avatar for kathija nafis

I worked on such a project about 10 years ago, I was one of a team of nearly 100 people and it took about 3 years.

Member Avatar for Ancient Dragon
0
46
Member Avatar for Ancient Dragon

Is it possible to create tables in the text editor that will retain spacing -- something like code tags but without line numbers?

Member Avatar for jeffcogswell
0
263
Member Avatar for Rahul47

The difference between `char *str="Hello World!!";.` and `char str[]="Hello World!!";.` is that char\* str is just a pointer into read-only memory where the string "Hello World" is actually stored, it's contents can not be changed. char str[] makes a copy of the string and puts it into read/write memory where …

Member Avatar for Ancient Dragon
0
226
Member Avatar for aka619ASH

To determine if a<b<c why not just use the normal simple if statement if( (a < b) && (b < c) ) { // true } then to determine if they are Pythagorean Triple: if( (a*a) + (b*b) == (c*c) ) { // true }

Member Avatar for scudzilla
0
228
Member Avatar for lmuller89

I think you can remove the warning by initializing those two pointers to NULL when they are declared on lines 18 and 19.

Member Avatar for Lucaci Andrew
0
5K
Member Avatar for vibhu mishra

Sounds like the console window is closing and killing the mp3. Add a PAUSE in the batch file after the line that plays the mp3 to keep the console window open while the mp3 plays.

Member Avatar for cgeier
0
346
Member Avatar for chubbyy.putto

The mode is the number that appears the most often in the array. If the array contains {1,2,1,3,4,5,8} the mode is 1 because it appears twice and all others appear only once. One way to calculate the mode is to use another 2d array, the first dimention contains a value …

Member Avatar for Ancient Dragon
0
183
Member Avatar for Elixir42

I assume you are using one of the Microsoft c++ compilers. If you want precompiled headers then every \*.cpp file in the project must include stdafx.h as the first header file. You can include any others you want after that. #include "stdafx.h" // precompiled header file goes first #include "myclass.h" …

Member Avatar for Ancient Dragon
0
205
Member Avatar for Seba Sama

ODBC is probably the oldest and most widely used database api in use. [Here ](https://www.google.com/#q=odbc+tutorial+c%2B%2B)is a google list of tutorials. Then there is the Microsoft ADO DLL, I think it's the same as you use in VB. [Here](https://www.google.com/#q=adodb+tutorial+c%2B%2B) are some links for it. Some database makers also have c and …

Member Avatar for Seba Sama
0
1K
Member Avatar for chubbyy.putto
Member Avatar for Ancient Dragon
0
329
Member Avatar for mixelplik

In the loop on lines 4-8, where is buffer incremented? line 4 always looks at the same character, which is why it's an infinite loop, unless buffer[0] == '\0' Try this loop while(buffer[a] != '\0') { cout << buffer[a]; a++ ; }

Member Avatar for Ancient Dragon
0
123
Member Avatar for pritaeas

pritaeas just deleted a duplicate post of mine and now the post reply count is 0 even though there is still 1 reply. I recall someone else reported the same issue a few days ago.

Member Avatar for Ancient Dragon
0
197
Member Avatar for Philip Carlo
Member Avatar for lmuller89

Please post the steps you took to produce the error. Which menu items did you select, and what did you enter. Better yet, get a screenshop of the console window that contains all the information and post it here. I compiled your program with VC++ 2014 and it compiled without …

Member Avatar for AndrisP
0
170
Member Avatar for mixelplik

Just call getline() which will do all that for you. ifstream in("filename.txt"); char buf[80]; while( in.getline(buf,sizeof(buf)) ) { // do something cout << buf << '\n'; }

Member Avatar for Ancient Dragon
0
4K
Member Avatar for jocker403

> line 50: this->i=2; since i is private derived classes cannot change it's value. You need to change base::set() (line 9) to accept an integer, then derived classes can call public set() to change the value of i.

Member Avatar for Ancient Dragon
0
131
Member Avatar for cambalinho

Not that I know of, but you can get the text itself. The size of the rectangle would depend on the font being used.

Member Avatar for cambalinho
0
2K
Member Avatar for riahc3

That was the year Dani copyright the web site, not the current year. All coptright notices are like that.

Member Avatar for mike_2000_17
0
171
Member Avatar for Rahul47

you can easily find out the size of an int by printing sizeof(int) -- but to answer your question, on most 32-bit compilers sizeof(int) == 4. If you are accustomed to using Turbo C, that is a 16-bit compiler and sizeof(int) == sizeof(short) == 2. But on most modern compilers …

Member Avatar for Ancient Dragon
0
231
Member Avatar for V3N0M

what you want is something like this: `char i2DArray[5][20]` That will hold 5 names, and each name can be up to 20 characters long. Then on lines 13-17: Note that you only need one loop, not two loops. for ( y = 0; y < 5; y++){ printf("Enter the name …

Member Avatar for V3N0M
0
150
Member Avatar for zaim.notty
Member Avatar for H_beginner

Delete both lines 10 and 11. Line 11 will never be executed because of the `k < k` condition in likne 10. [Here ](http://en.wikipedia.org/wiki/Loop_unwinding)is a good article about loop unrolling. One of the optomizations you would make is to calculate `i*j*ida `only once within a loop, save the result in …

Member Avatar for H_beginner
0
295
Member Avatar for Ancient Dragon

I have another birthday anniversary today, I'm now only 39, with 32 years of experience.

Member Avatar for Stuugie
0
148
Member Avatar for furalise

maybe something like this: void mystrcat(char* dest, const char* source) { while(*dest) dest++; while(*source) *dest++ = source++; *dest = 0; }

Member Avatar for furalise
0
297
Member Avatar for Zilphia

line 16: I'd use int instead of double because there is no need for decimal places. lines 17-31: remove the commas, numeric literals must not contain commans. Also, add a comma after each of those lines, then add a semicolon after the last one. const int Mustang = 55000, Harley …

Member Avatar for jeremy316
0
725
Member Avatar for visakh_Here

The file is open for writing only. fscanf() is a read function. Solve the problem like this: line 9: open the file with "rw" flag line 15: uncomment that line. add a new line just before line 15: `fflush(fp);` which will force everything to be physically written to disk. Until …

Member Avatar for mathematician
0
120
Member Avatar for mixelplik
Member Avatar for jamesjvj
0
168
Member Avatar for Learner010

Header files only contain function prototypes, not the functions themselves. You need to put the functions in a library. To use them just link the program with the library (\*.a, \*.so or \*.lib) just as you would with all other standard compiler libraries. how to create a library depends on …

Member Avatar for Learner010
0
231
Member Avatar for Roobin

why are you passing fractional values instead of whole numbers. When you pass 0.02 does that mean to get the line that contains 2 zeros, e.g. 100? Then why not just pass 2 instead of 0.02?

Member Avatar for Roobin
0
255
Member Avatar for webecedarian
Member Avatar for Emma_3

You have break statements in the wrong place. Move the break statement on line 42 down to line 71. Move the break statement on line 78 down to just below line 98.

Member Avatar for AndrisP
0
219
Member Avatar for mustafa.bahaa
Re: c++

What verson of Borland compiler are you using? Many of the old 16-bit Borland compilers were created before the c++ standards and require \*.h file extension // cin with strings #include <iostream.h> #include <string.h> #include <conio.h> //using namespace std; int main () { string mystr; cout << "What's your name? …

Member Avatar for mustafa.bahaa
0
220

The End.