15,300 Posted Topics
Re: why the loop on line 30? that is destroying the contents of the file that was read on likne 26. | |
According to [this article](http://www.infoworld.com/t/microsoft-windows/microsoft-confirms-its-dropping-windows-81-support-240407), Microsoft will no longer issue security updates to Windows 8.1 if you don't install the update path. >Since Microsoft wants to ensure that customers benefit from the best support and servicing experience and to coordinate and simplify servicing across both Windows Server 2012 R2, Windows 8.1 … | |
Re: You could use defines instead of the enum on line 1 but that wouldn't be any beneficial than what you have now. | |
Re: How is pin declared? Assuming it's `char pin[5];` line 6 should be `scanf_s("%s", pin);` Note you don't need the & address symbol because the compiler will always pass the address of arrays. | |
Re: What's your educational level? Ph.D. is preferable for doing such research. | |
Re: You might have that problem if the library was built a C code and your program is attempting to call it's functions as C++ code. If that is the case then you need to tell the compiler that the library is C and not C++. #ifdef __cplusplus extern "C" { … | |
Re: I think you will have to use something like Skype to do that, or you can spend a couple years reinventing the wheel by writing your own Skype program. | |
![]() | Re: How were you able to post this thread if you are not registered? >I tried formatting my Windows from beginning. You mean you really reformatted your hard drive? Why? >Tried registering to 10 different forums and same problem. You mean you get the same problem on all 10 forums? Maybe … |
Re: In c++ a struct is nearly identical to a class. Just rename the struct to class and make members public | |
Re: You don't need an array. lines 14, 15 and 16 is the wrong kind of loop. There is no restriction on the number of integers that can be entered. You could enter a billion numbers if you desire. You only have to keep track of 2 things: sum of the … | |
Re: Lines 1-4 are all incorrect. You can't declare character arrays like that and you can't use gets() like that. I think you need to pay more careful attention to how those are done. For example `char in[20];` | |
Re: The second one is because l_aAPtr is an array. | |
Re: emails are blocked until you have been a member for a certain period of time and made several posts. I don't know how much time or the number of posts, but it's more than what you have now. Begin actively helping others in other forums and you will eventually be … | |
Re: _cdecl is the default calling convention for Micosoft Visual Studio. There is no need to explicitly use CDECL. _vsntprintf() -- wrong. ([link](_vsntprintf )). How is _vsntprintf() supposed to know the size of the first parameter??? Please study [a tutorial](http://www.cprogramming.com/tutorial/lesson17.html) on variable arguments, then you will understand how that function is … | |
Re: One reason -- With C/C++ you can directly access hardware. | |
Re: Before comparing a pointer to NULL you have to initialize them to null when you declare the pointers (or at least some time before using them). If you don't then the the value of those pointers are whatever happens to be in memory at the time they are declared, which … | |
Re: line 10: No, you can't concantinate C strings like that char fname[255]; char *ptr; strcpy(fname,argv[1]); ptr = strchr(fname,'.'); // truncate extension if( strcmp(ptr,".txt") == 0) { printf("Error: can't write to the same file as input file\n"); } if( ptr != NULL) *ptr = '\0'; strcat(fname,".txt"); Data3 = fopen(fname,"w"); | |
Re: > student enter his name in digits no dought it is wrong Not necessarily -- depends on where you live. In some places it might be perfectly legal to name a baby R2D2. | |
Re: >It is possible to use any number of characters '/' as a delimiter in path instead of one traditional '/'. FIt is possible to use any No. When in doubt test it in a command prompt. MS-Windows accepts only a single / character immediately before each folder name. | |
Re: The entire class is quite dangerous -- how can you be sure the results of line 43 will not overflow the size of str (line 7)? line 20: What is the contents of str at that point? Hint: undetermined because you failed to initialize str in the constructor. Just setting … | |
Re: line 84: flush the input stream here. You don't need cin.ignore() in the other places where you have it. Also, study [this thread ](http://www.daniweb.com/software-development/cpp/threads/90228/flushing-the-input-stream)how to flush the input stream. Just using cin.ignore() may not do it. #include <limits> ... cin.ignore(std::numeric_limits<std::streamsize>::max(), cin.widen('\n')); | |
Re: because on line 35 you are passing s and s has not been initialized. I would change input() to accept the parameter by reference and not by value. Why are you using gets()??? you should be using cin.getline() void input(book& details) { cout << "Book Title : "; cin.getline(details.title, sizeof(details.title)); … | |
Re: Which to use will depend on your compiler. Old Turbo C++ will use iostream.h but all recent compilers use <iostream> (without the .h extension) You also need a using statement. #include <iostream> using std::cout; using std::cin; | |
Re: You can't just remove a row from a statically allocated array, and it's a little tricky to remove a row from a dynamically allocated array. For statically allocated arrays the best you can do is to copy the contents of all the rows you don't want to remove up to … | |
Re: that error means you failed to implement that function in your \*.cpp or \*.h file. Also recheck spelling and capitalization to make sure they are consistent. | |
Re: > wonder why UVA doesn't accept my answer How are we supposed to know that? You didn't even tell us what that program is supposed to do. And what is UVA? My guess University of Virginia??? | |
Re: Or change line 13 to this so that token has a pointer to unique memory: `token[i]=strdup(buff);` | |
Re: you can't shift an 8-bit char by 24 bits (line 20). What are you trying to accompolish? Why do any shifting at all? If you're attempting to read a 4-byte integer, why not just do it the simple way int num = 0; file.read((char *)&num,sizeof(int)); | |
Re: [MessageBox](http://msdn.microsoft.com/en-us/library/system.windows.forms.messagebox.aspx) is from the .NET framework and can ben called by any of the .NET languages. [MsgBox ](http://msdn.microsoft.com/en-us/library/139z2azd(v=vs.90).aspx)is older VB only. | |
Re: >i also understand this but how to concatenate two or more string usin operating overloading Did you study the code in this thread? The OP created a class similar to std::string that concantinates two character arrays (not std::strings). | |
Re: >i want a full code Sorry, you are not going to get it. We don't do people's homework for them. ![]() | |
Re: Done. Next problem. | |
Re: Maybe you need admin permissions to do that. Move the pdf file somewhere else such as c:\temp and see if the problem goes away. | |
Re: One reason not to upgrade to Windows 8 is because a few programs that run ok on win 7 won't run on win 8, such as M$ Office 2010. I tried for over a week to get office 2010 to work on win 8 and every attempt failed. Finally bought … | |
Re: >my assignment code is not commented (in hindsight that was a mistake) and I do not understand it anymore. I can't tell you the number of times I've heard that same story. Sorry, but I can't help you with your question. | |
I'm using VS 2013. I want to use the system.numerics.biginteger structure but VS says there is no such namespace as system.numerics! According to MSDN there should be. What am I missing? Imports System.IO Imports System.Numerics '<<<< error Module Module1 Sub Main() Dim OneLightYearInches As BigInteger = 372469703661417000 End Sub End … | |
| |
Re: I could have sworn that I've seen this posted in DaniWeb C++ forum void foo(int n) { int ay[n]; ... ... } I'm reading "The C++ Porgramming Language, 4th edition", and on paragraph 4.3 he specifically states that "The number of elements in the array, the array bounds, must be … | |
Re: The way I understand it your move constructor is not correct. The intent of the move constructure is to move data objects from one class to another, not to mearly assign a value to the current class. See [this article ](http://msdn.microsoft.com/en-us/library/dd293665.aspx)for full explanation. [Here](http://stackoverflow.com/questions/3106110/what-is-move-semantics) is another good article from StackOverflow | |
Re: You have several syntax errors. Here are the corrections. Note that the return value of malloc() can't be typecase to something called `data`. In C language a typecase of void* return value is necessary (but it is in c++). #include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include "Vector.h" void … | |
Re: you need to replace lines 8 and 9 with code that opens and reads a text file. Do you know how to read files? Also, delete line 2, there is no reason to include cstdlib | |
Re: c++ language itself does not have an api for database access. As a beginner accessing any SQL compliant database is probably going to be very challenging. Before doing anything you need to study the SQL language so that you know how to request data and update the database. Without that … | |
Re: post the code you have tried so that we can help you. Nobody here is going to write the whole thing for you. | |
Re: storedValue on line 13 is an object of each instance of the class. Each instance of intCell has it's own copy of storedValue. The objects on lines 34 and 40 are two different instances of the class, so they will not have the same copy of storedValue. If that is … | |
![]() | Re: boost will be the most portable between MS-Windows, \*nix and MAC. I'm not familar with the other two. ![]() |
Re: what did you enter for cyp? gets() doesn't accept spaces. You should NEVER EVER use gets() because it can corrupt your program's memory when you enter more characters than the buffer can hold. Instead, use fgets(), such as `fgets(cyp,sizeof(cyp),stdin);` scanf() with "%s" has a similar problem, you can use "%149s" … | |
Re: Moschops already explained the error message over 8 hours ago. Either you failed to read it or didn't understand it. You have to have a function called main() in your program. | |
Re: >i am just curious to know if there are any at home remedies that I can make for him Use a pair of sizzers and cut them off. |
The End.