15,300 Posted Topics
Re: multi-statement for loops and if statements require { and } around them for(i = 0; i < 10; i++) { // blabla } line 23: y < y will never ever be true. Probably should be y < 10 | |
Re: You can use c++ but it's somewhat complicated. A lot easier if you use C# or VB.NET. If you want to use MySQL database then they have a c++ class for that named MySQL++. For Microsoft Access you can read any of [these tutorials](https://www.google.com/#q=adodb+tutorial+c%2B%2B). The most generic way to access … | |
Re: I have not heard anything about that, [here](http://channel9.msdn.com/Forums/Coffeehouse/whats-stopping-C-being-made-as-a-nativeunmanaged-language) is a related article. >When will this compiler be available? If there is one in the works it will probably be several years down the road. | |
Re: If you are trying to get rid of a virus wouldn't it be a lot easier to just run an antivirus program and let it remove the virus then to reinstall the operating system? | |
Re: If you already know the name of the file to check, then there are several options. One option is try to open the file for reading, if that succeeds then you know the file already exists. Another way is to call _stat() (on Windows) or stat() (on \*nix) which will … | |
Re: The second parameter to getRowTotal() and getColumnTotal() is the row or column you need to work with. The code will be very similar to the one you did for getTotal(), except you only need one loop instead of two. For example, for getRowTotal() all you need to do is loop … | |
Re: Probably depends on what compiler you are using. Here's the output from VC++ 2013 1 1 2 3 3 9 4 33 5 153 6 873 7 5913 8 46233 9 409113 10 4037913 11 43954713 12 522956313 13 2455009817 14 3733955097 15 5738265113 Press any key to continue . … | |
Re: The file probably has a '\n' after the last character. Edit the ffile to remove the last '\n' variable c should be declared as int, not char, because fgets() returns an int. `int c;` line 17: It is not necessary to do that, just print like this: `printf("%d %c\n",c,c);` | |
Re: Whare does the table already contain? Just add two more columns -- one to count the number of times the member uses the golf course and another to count the number of guests. When a member comes to the golf course look up is row in the table and increment … | |
Re: Why go with either? Do you already have a college degree or do you have prior development experience? You can get development jobs without any Microsoft certs. | |
Re: Did you look up their descriptions on MSDN? [Win32_DiskDrive](http://msdn.microsoft.com/en-us/library/aa394132(v=vs.85).aspx) [Win32_LogicalDisk](http://msdn.microsoft.com/en-us/library/aa394173(v=vs.85).aspx) [Win32_Volume](http://msdn.microsoft.com/en-us/library/aa394515(v=vs.85).aspx) [Win32_DiskPartition](http://msdn.microsoft.com/en-us/library/aa394135(v=vs.85).aspx) | |
Re: move lines 14-23 into a method, you can't have executable code outside functions. | |
Re: That's not a question, it's simply a statement of the program you have to write. -- we don't do homework for people. You write the program then ask specific question(s) about what you don't understand. | |
Re: Probably because the are not explicitely called in your code, so what good would it do to return a value -- nobody is going to be listening. The constructor is only called when you instantiate an object. There is no way to catch the return value of the constructor. [code] … | |
Re: Be aware that such a file is going to get pretty large very quickly if there are a lot of users being tracked, and you have only one function or program actually writing the data because it has to have exclusive use of the file in order to write it. | |
Re: WOW! Do you really want all the sql servers on the internet??? That could be millions of them. | |
Re: Windows Forms is c++/CLR, which is a slightly different language than c++. c++/CLR is more like C# and VB.NET and all three are based on the .NET framework. But for quick GUI use Windows Forms. None of those options have anything to do with serial communications. Once you have the … | |
Re: Yes, can you? [Here](http://www.daniweb.com/software-development/cpp/threads/67312/connecting-c-to-ms-access) is a related article. | |
Re: Displaying the ascii value is simple -- just typecast it from int to char. | |
Re: Hint: The first question, about converting from text 'A' to ascii 65 Every character you can type from the keyboard has a numeric value. See [this standard ascii table.](http://www.asciitable.com/). In C and C++ you don't have to do anything at all special in order to convert from 'A' to 65 … | |
![]() | Re: Probably because heapInsert() changes the value of size from 10 to 11 and there aren't 11 elements in the array. You can't just arbitrarily change the size of a statically declared array. ![]() |
Re: LINE 33 is doing integer division which means there are no decimals. So 20/100 is 0. You need to use float, for example` 20.0/100.0` | |
Re: Working with databases is a little complicated, but see Chapter 13 of [this free tutorial](http://www.homeandlearn.co.uk/NET/vbNet.html) | |
Re: No one is going to do your homework. Please post the code you have attempted to write and ask specific questions about what you don't understand. Do the assignment one function at a time, don't attempting to write them all at once. Write a little code, compile, correct errors, then … | |
Re: >Difficulty in programming. Don't feel alone -- that is a common feeling even among experienced programmers. Well maybe there is one exception, our moderator Mike. | |
Re: Also, time.h is only accurate since 1970 (I think that's the beginning date). So if you wanted to calculate how many minutes I've been alive you wouldn't be able to do it with any of the functions in time.h. AFAIK the only way to do that is to use [boost … | |
Re: switch statements do not permit ranges, so the only way to do that would be something like this: switch(qty) { case 21: case 22: case 23: case 24: case 25: case 26: case 27: case 28: // etc etc through 40 discouint = 0.05F; break; case 61: case 62: case … | |
Re: I just forced Windows Update on my Windows 8.1 PC and I don't have that new start menu. Is that a 3d party Start Menu as in another article you wrote awhile ago? | |
Re: What has your rant have to do with DaniWeb? No one at DaniWeb can do anything about bad google results. Maybe you are just entering the wrong keywords in google?? | |
Re: Sorry, but I don't understand the assignment. "America's 50th celebration.", what 50th celebration? US has been a nation for over 225 years. >The algorithm should accept and store the actual dollar value that will be allocated to the parishes. US has no such thing as "parishes". A parish is a … | |
Re: floats and doubles can't be eaily compared for equality due to rounding errors in memory. Read [this](http://www.daniweb.com/software-development/cpp/threads/475310/someone-please-help#post2075679) related thread | |
Re: Where are several books by that author. Which one do you want? I suppose you will have to buy with your money the whole book in order to get just a single chapter. | |
Re: Line 24 is unnecessary because the string is already null terminated. Also, you are null terminating the string in the wrong place. line 38: illegal statement. Must be `arg[++count][0] = '\0';` line 40: That is a memory leak. tokens is not a simple block of memory. You have to free() … | |
Re: on line 32 filename is used before it has been allocated. filename is nothing more than an unallocated pointer. Since this is a c++ program instead of C, suggest you use std::vector<std::string> to hold filenames instead of that structure you declared on line 1. | |
| |
Re: AFAIK there is no such library. I worked on a project which included RBAC and all we did was (1) define what class of users have access to what program features. (2) When a user logged into the program (needed user name and password) the program looked up the roles … | |
Re: Maybe you did something wrong. This is what I get 00AFFF10 00AFFF04 Press any key to continue . . . #include<iostream> using namespace std; int main(){ int fish = 6; int * fishp = &fish; cout << fishp << ' ' << &fishp << endl; return 0; } Are you … | |
Re: Is it correct? No. You can't nest one function inside another. #include <stdio.h> #incluede <string.h> void getname(char name[][50],int num) int main() { char name[5][50]; int numofname = 5; getname(name,numofname); } void getname(char name[][50],int numofname) { for(int i=0;i<numofname;++) scanf("%[^\n]",name[i]); } | |
Re: If you don't know what namespaces are then you need to read a good tutorial because namespaces are fundamental to c++ language. Namespaces were invented to keep from getting name conflicts from one file to the next, that was a big problem in C language. For example, file A.h might … | |
Re: What language is this? My guess is C# but not sure. | |
![]() | Re: what is the expected output? ![]() |
Re: [Really](http://lmgtfy.com/?q=python+download)??? | |
Re: There are a lot of articles about this, just [google](https://www.google.com/#q=c%2B%2B+video+capture+library) for them. | |
Re: Yes, but you will have to post it because my eyes are not good enough to see your monitor from where I am sitting. AFAIK there are no win32 api functions named PutText() and GetText(). | |
Re: It' just standard c++ ifstream and ofstream. When the program starts, try to open the file, if it success then read it. | |
Re: >In Windows if we create an exe with MSVC6.0 a corresponding ".lib" file is generated. No it is not. The lib file is only generated if you create a library project. In \*nix you have to create a shared library. How to do that will depend on your compiler. [Here](https://www.google.com/#q=how+to+create+a+shared+library) … | |
Re: call srand() at the very beginnning of the program, and before the first time rand() is used. Usually srand() is called with the return value from time() so that srand() gets a different number every time it is called. That will prevent rand() from returning the same set of numbers … |
The End.