15,300 Posted Topics

Member Avatar for COKEDUDE

look in your compiler's limits.h header file. You will find them all there. >and anything bigger than that? That doesn't make any sense. What do you mean by "bigger than that"? >And also how to calculate this? How to calculate what? sizeof(object) returns the number of bytes required to store …

Member Avatar for rubberman
0
100
Member Avatar for srao1

Line 23: what exactly does sizeof(buf) return? Answer: check line 10 and you will see buf is declared as 1024 pointers, so sizeof(buf) is 1024 \* sizeof(char\*). Assuming sizeof(char\*) == 4 (which it does on MS-Windows and \*nix) sizeof(buf) = 1024 \* 4 = 4096. From briefly reading some of …

Member Avatar for Ancient Dragon
0
378
Member Avatar for daniweb2013

[QUOTE=fzafarani;432095]Yes, I want to write my own C++ compiler [/QUOTE] Good luck :) Unless you have a Ph.D. in computer science and mathametics plan to spend the next 20 or so years writing it.

Member Avatar for LordoDeGrim
0
752
Member Avatar for srao1

You can easily skip the first line by calling fgets() to read it, then just don't use what was read. Do any of the strings contain spaces? fscanf with %s can't read the spaces. If there are no spaces with the strings then the fscanf line you posted will probably …

Member Avatar for Ancient Dragon
0
6K
Member Avatar for pravej
Member Avatar for christinetom

a+b adds the two ascii values. Look at [any ascii table](http://www.asciitable.com/) and you will see that 'a' == 97 and 'b' == 98, so a+b = 97+98 = 195. Now look again at that ascii table and find the character whose ascii value is 195. What you want to do …

Member Avatar for christinetom
0
466
Member Avatar for nhrnjic6

Other than poor formating, I don't see anything wrong with how you allocated the array. The values in the array are something else. void John_is_3D(int dimx, int dimy, int dimz) { int ***John; // pointer to pointer to pointer John = new int**[dimx]; // array of pointers to pointers for …

Member Avatar for Ancient Dragon
0
184
Member Avatar for yann.bohbot.9

[Here'](http://www.programmingsimplified.com/c/source-code/c-program-convert-decimal-to-binary)s one way to do it.

Member Avatar for Banfa
0
147
Member Avatar for zaxo311

To delete the inner list just iterate through the list and delete each node one at a time, something like this: It assumes head->item_data pointer is NOT NULL, so you should probably test for that before executing any of the code in this function. void DeleItemList(struct client* head) { struct …

Member Avatar for zaxo311
0
430
Member Avatar for rogerdv
Member Avatar for Ancient Dragon
0
196
Member Avatar for CreatorZeus

line 5 is wrong -- notename[x] is a single character and c_str() returns a string. Maybe line 1 is incorrect -- `string notename[10];` which would mean notename is an array of string objects. string notename = "filename.txt"; x = 1; cout << notename << endl; if(remove(notename.c_str()) != 0) { perror( …

Member Avatar for Ancient Dragon
0
336
Member Avatar for KushMishra

I would be very surprised if you found any language translator that did the job 100% correct -- the .NET functions would be easy, but the rest nearly impossible due to differences in the two languages.

Member Avatar for JOSheaIV
1
452
Member Avatar for kamalashraf

create another class for those two then you can make an array of that class. See the examples posted in your other thread.

Member Avatar for Ancient Dragon
0
107
Member Avatar for kamalashraf

If you have not yet studied structures then declare two arrays, one for 10 student names and the other for the sections. This assumes the names book1, book2, etc never change, so there's no point in storing those strings. If, however, those names can be different for each student then …

Member Avatar for deceptikon
0
101
Member Avatar for mayyy

what exactly is your question(s) about how to write that program. You will need to use functions srand() and rand() which generates the random numbers, then save the values in an array. Each time a new random number is generated search the array to see if it's already there. If …

Member Avatar for Ancient Dragon
0
94
Member Avatar for olegb

What event is supposed to cause the program to run? If the program only needs to run once or twice a day then use the operating system to schedule it as G_Waddell suggested 2 days ago.

Member Avatar for pritaeas
0
302
Member Avatar for ibpet11

The file will do no good without the server. The target computer must have the server software or the server must be on a computer that the target computer can access, such as both computers on the same network.

Member Avatar for ibpet11
0
152
Member Avatar for zaxo311

Function AddClient() doesn't return anything. Either make it return something or make it a void function. Try this, where I've remove redundent code. Try this version, where I removed redundent code. void AddItemToClient(struct client *head, char item_name[30], char item_state[30], double price, char status[30], double price_if_not, int day, int month, int …

Member Avatar for zaxo311
0
937
Member Avatar for CreatorZeus

You can also do it with [_stat()](http://msdn.microsoft.com/en-us/library/14h5k7ff.aspx)

Member Avatar for duskoKoscica
0
535
Member Avatar for COKEDUDE

>Will the while loop get confused by multiple NULL characters No, it will stop when it encounters the first NULL character, all others are ignored. >will fscanf be able to overwrite the NULL character each time Maybe, it will try to store as many characters as it can in the …

Member Avatar for Ancient Dragon
0
182
Member Avatar for Labdabeta

>Is there any reason I should rename it to eulerTwo? You can, but it's not necessary. There is nothing wrong with using numbers in function names -- it's actually pretty commen.

Member Avatar for Labdabeta
0
227
Member Avatar for mattyd

I've noticed similar problems quite often, so I got into the habbit of refreshing the page after pressing the "Submit your Reply" button. If I don't sometimers the edit I just made disappears. Refreshing the page seems to solve the problem.

Member Avatar for Dani
0
361
Member Avatar for Schol-R-LEA

The only time I have found recursion useful is when transversing the file system, such as in [this](http://www.daniweb.com/software-development/cpp/code/216812/searching-linux-directories) code snippet. Otherwise I try to avoid it, mainly because many years ago recursion was just too expensive in terms of memory and time. I know those aren't as critical any more …

Member Avatar for Ancient Dragon
1
2K
Member Avatar for Vikram Sehgal

@Gensk: You didn't say what operating system you are uing. The sugestion by deceptkion works only on MS-Windows. If you are using \*nix then you will have to do something else.

Member Avatar for Ancient Dragon
0
320
Member Avatar for Randy001

Its not the compiler but the touch screen device driver. Is this for a PC or wireless? touch screens on a PC are all different so you will have to read the manufacturer's programming documentation to find out how to interface with it. Its been about 10 years since I …

Member Avatar for Brian_8
0
359
Member Avatar for EddieC
Member Avatar for blue_Student

what is inarray()? You have too much duplicate code in that function. This is the recommended way to write such functions, not that it does not call feof() at all, but relies on fgets to return NULL then end-of-file is reached. else { while(fgets(word1, 30, fileIn) != NULL) { //succeeding …

Member Avatar for Ancient Dragon
0
285
Member Avatar for karlicek

You need to post the structure. Is left and right pointers to ITEMTREE structures? > but proposed code notice failure You need to be more specific about the erors. compiler errors? If so, what are they? Runtime errors? What is the behavior of the program?

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

Were those two structures given to you or can you make them up yourself? There are two linked lists -- Client and within each client node is a Items linked list. To add a new client node you have to search the Client linked list to see if it is …

Member Avatar for zaxo311
0
433
Member Avatar for aVar++

No order the this list Ink Masters Tatto Coverup Judge Judy Law and Order SUV Top Gear (UK version) Dr Who Star Trek (all of them) American Ninja Warrior Big Love (HBO series)

Member Avatar for Reverend Jim
0
230
Member Avatar for ArashVenus

>@mike so simply by using static in every function we mean that we want this variable to be related to the function only No -- variables declared within a function are never visible to other functions, and they are auto destroyed as soon as the function returns to it's caller. …

Member Avatar for Ancient Dragon
0
230
Member Avatar for Builder_1

That's a microsoft compiler thing -- it supressed warning number 4996, which is a warning about deprecated functions. Just delete that line if you use another compiler. > how can we cout the locations What do you mean by "locatins"? The vowel's position within the string? Such as there is …

Member Avatar for Ancient Dragon
0
163
Member Avatar for katongo360

Yes, but only if you help yourself out. Please post the code you have attempted then we can answer questions you might have.

Member Avatar for ArashVenus
0
189
Member Avatar for Ancient Dragon

Where did you hide the Indorsement button? I can't find it anywhere. Nevermind -- I figured it out. There used to be a button in the purple ribbon, but I guess you got rid of it probably because it was consuming too much realestate. The list of people to endorse …

Member Avatar for diafol
0
255
Member Avatar for parivallal.j

Is there always just one number on a line, or can a line have more than one number? If only one number, then just count the number of lines in the file.

Member Avatar for richieking
0
96
Member Avatar for nitish.mohiputlall

r/1200 is doing integer math which means all decimals are discarded. So 10/100 is 0 because 10 cannot be divided by 100. You can fix that in one of three ways (1) Declare r as float instead of int, then use scanf("%f") instead of scanf("%d") (2) Typecast either the numerator …

Member Avatar for Banfa
0
183
Member Avatar for joydsouza90

maximum is the size of the screen and its resolution, usually 25 x 80. The 35X25 was common when PCs first came out in the early 1980s. But MS-Windows console screens have much smaller fonts and more rows.

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

For numbers you have to do a little more processing -- convert the ascii value of the char to binary then add it to an integer. This works for English language and standard ascii character set. I have no idea what you intend to do with the number, but whatever …

Member Avatar for COKEDUDE
0
309
Member Avatar for bbub
Member Avatar for mixelplik
Member Avatar for PulsarScript

First you have to create a project, that will generae a default \*.cpp file. You can put your class there or add a \*.h file to the project. You might want to read Getting Started page [here](http://msdn.microsoft.com/en-us/library/dd492171.aspx).

Member Avatar for Ancient Dragon
0
137
Member Avatar for itzarun
Member Avatar for nowewiesci

c++ is used for a great deal more than web development. Most PC games and desktop apps are written in c++. c++ can also be used as CGI programs (google "CGI programming")

Member Avatar for pritaeas
0
153
Member Avatar for ryanpalma0794

There are many kinds of databases: simple text files, binary files, and numerous SQL compliant databases such as MySQL (free). Which kind do you want to create?

Member Avatar for Ancient Dragon
0
360
Member Avatar for mike_2000_17

I was going to test using Visual Studio 2014 to see how the results compared with yours. But VS won't even compile it due to this line `task_type tasks[total_sum / min_coin + 1]; // <- use VLA`

Member Avatar for Tumlee
4
685
Member Avatar for ddanbe

I wouldn't want such a pill -- think about it, I wouldn't get Social Security for another 900 or so years!

Member Avatar for Ancient Dragon
2
2K
Member Avatar for Warrens80

Christmas has an [interesting history](http://www.history.com/topics/christmas). It was not a holiday in early America, and in fact was outlawed in Boston for a few years. Christmas didn't become a federal holiday in America until 1870. I anticipate one day in the not-too-distant future Congress will pass a law abolishing it as …

Member Avatar for Reverend Jim
0
1K
Member Avatar for inspire_all
Member Avatar for blue_Student

(1) Use your compiler's debugger so that you can step through the execution of the program and see where it stops. (2) or scatter some print statements around.

Member Avatar for deceptikon
0
354
Member Avatar for getmeusername

UDP is not recommended for long distances because there is no guarentee that the packets will ever arrive. TCP is best for that.

Member Avatar for Ancient Dragon
0
166

The End.