15,300 Posted Topics
Re: In C language, before version c99, you have to declare all objects at the beginning of the block. Reverse the order of lines 8 and 9 so that the declaration of pFile is the first thing in the function. C++ does not have that restriction. | |
Re: >>from my mobile phone Do you really mean you want to write a progrm [b]for[/b] your mobile phone? I know of no compiler that runs on a mobile phone. You will first have to find out what operating system it is running. Is it Microsoft Mobile 5.0 or something else. … | |
I'd like to see a larger edit box -- one similar to the quick reply box. That one-line edit box is just too small when we want to write several words. What you have now works ok, its just not convenient for larger amounts of text. | |
Re: why do you want to do that? I see no advantage of using pointers in that program, they could actually make it more difficult to read and comprehend the algorithm. | |
![]() | Re: You have to allocate memory for hModules array before calling EnumProcessModules() because that function doesn't do it for you. Study the MSDN page about [EnumProcessModules()](http://www.daniweb.com/software-development/cpp/threads/421828/getting-base-address-of-a-process) more carefully and follow the examples links near the bottom of that page. Don't try to allocate an array exactly the size needed because that … |
Re: I'm now starting to use wordpress to create my web site. I was using vBulletin, but I'm starting to regret that because of its complexity, lack of documentation (for newbe like me), and lack of tech support on their web site. There is a bbPress forums plugin for WordPress but … | |
Re: > I was just able to successfully upvote, Same here. Maybe he needed to hit the refresh button on his browser -- I have to do that occasionally. | |
Re: > name == "James" || "Ellen" || "John") which || means OR, correct? name == "James" || name == "Ellen" || name == "John" | |
Re: Have you worked through some winsock tutorials? ([click this](http://search.mywebsearch.com/mywebsearch/GGmain.jhtml?searchfor=winsock+tutorial&x=0&y=0&st=tab&si=101497_819pcc&ptnrS=CDchr999YYus&ptb=E426119D-E1FE-4134-AB7A-C6FDE5ABCFF5&n=77ed268a)) | |
Re: The first parameter to that function needs to be a pointer so that it can be added to the list. What you are doing now is just setting a pointer to a local variable, which goes out of scope as soon as that function returns. You should ALWAYS pass structures … | |
Re: When I was working I never, or rarly, took breaks that laster longer than just a few minutes, such as get up and get a cup of coffee. It really annoyed me to no end when someone interrupted me while I was deep in thought coding, especially those pesty bosses … | |
Re: They are all still there -- you have to change the View File settings in order to see them. In Windows Explorer choose menu item Tools --> Folder Options --> View tab, then scroll down to Hide Protected Operating System Files and uncheck it. | |
Re: > I would like to know your opinions how much time is needed to study so that your knowledge would be up to date and you would not get fired of job? :) I IT people don't become technologically obsolete over night -- it takes several years for that to … | |
Re: You don't use & to pass characters arrays by address, they are always passed like that example: scanf("%s",cus[i].name); | |
Re: I don't see where BuildingsArr is declared. If its a pointer, sizeof won't give you what you are lookinig for. sizeof gives you the number of bytes consumed in memory for the object. For pointers, it will be 4 because sizeof(any pointer) is 4. | |
Re: > The amount of reputation points you're affecting the member by is now transparent because I think this leads to more genuine voting, without letting how much you're affecting the member sway your vote about the individual post I don't think its transparent -- the Power to Affect someone else's … | |
Re: No, but one thing you can do is make a linked list of fixed-length strings (like buffers). Just keep adding to the list as data is received. Then when everything is received you can calculate the size needed, allocate the string memory, then concantinate them all together into one big … | |
I have started a new vBulletin site and one of the forums is going to be for adults only, over age 17. Right now when a new member registers he/she can put whateve age he wants. Before allowing access the the adult-only forum I'd like to verify that the person … ![]() | |
Re: call fgets() to get user input, then strtok() to break it up into individual words. I would just statically allocate the array of pointers to strings, for example `char* strings[255] = {0};` . You could, as previously mentioned, also use a dynamically allocated array of pointers `char** strings = 0`, … | |
Re: I love the new change for code tags :) :) :) And the ability to hide preview. The backspace key doesn't work in Chrome. but it works ok with IE9 | |
Re: [url=http://www.daniweb.com/forums/member.php?u=888707]dioioib[/url] has reported a post. Reason:[quote]advertisement[/quote] Post: [url=http://www.daniweb.com/forums/showthread.php?p=1783437#post1783437]Formatting disks on MAC OSX[/url] Forum: Mac OS X Assigned Moderators: Tekmaven, crunchie, blud, jbennet, WaltP, Nick Evan, PhilliePhan, DimaYasny, Ezzaral, jholland1964 Posted by: [url=http://www.daniweb.com/forums/member.php?u=949872]Klementina[/url] Original Content: [quote]OnSite.ru —a system that allows you to create your own web sites and manage them without … | |
| |
Re: she means that the parameters on line 15 and line 58 do not match. They have to be the same. Also, its best to always pass structures around by reference, never by value, because the program has to duplicate everything in the structure when it is passed by value. You … | |
Re: Possibly line 11 of main.cpp -- std: is a label, you want std:: (two colons, not just one). The three set functions in the header file should be void functions because they do not return strings. Your compiler should be giving you warnings about that in the implementation *.cpp file., … | |
Re: > I suggest this one, because ideally a compiler shouldn't crash no matter what you feed it. Compilers often have bugs just like any other program. I've even had earlier versions of Microsoft compilers crash on me for internal compiler errors. | |
Re: you know that each letter of the English alphabet has a decimal value, which can be found in any ascii chart, such as .[this one](http://www.asciitable.com/). So, to solve your problem all you have to do is subtract the ascii value of 'a' from whatever the user input, then add 1 … | |
Re: The simplest IMHO to solve the error problem is to get input as a string then parse the string to see that it contains all numeric digits. If it's ok then convert it to an integer by calling one of the standard conversion functions. This method has the advantage that … | |
Re: No. Memory for those pointers in the structure has to be allocated, and the amount of memory to allocate won't be known until you get the results of the query. sqLite won't do that for you. | |
Re: Probably some file(s) need to be recompiled. Select menu Build --> Clean Solution, then rebuild the solution and that normally fixed the problem. | |
Re: After you write the string you have to rewrind the file pointer before you can read it again. See fstream's seekp() function and set the file pointer back to the beginning of the file. | |
Re: Post the node strucure. How is node->name declared in the structure? | |
Re: what error(s) are you getting and on what line numbers do they appear. Unfortunately you didn't use code tags cofrrectly so we can't copy it to our editor and compile it ourselves. And PLEASE do not type in all caps -- that makes us think you are screaming at us. … | |
I see a lot of posts where some of the code is in code tags and some not? What's with that? Example here: http://www.daniweb.com/software-development/cpp/threads/420885/data-structure-stack | |
Re: It is trying to push a string to a vector of integers. Won't work. What you have to do is read the file as integers, not strings. There is a couple ways to do it. The easiest (IMO) is to use getline() as you have it now, but add the … | |
Re: What exactly is the problem you have? Are you trying to read the whole file into memory at one time? Or just read small parts of it? | |
Re: > Narue has decided to retire her account on Daniweb Again! She does that every now and then. Will you be assigning a Super-Mod to taked Sanjay's place? | |
Re: 5) annoying, but I can live with it. 4) Agree completly with Walt. There must be an easier way top quote someone other than manually copy/paste Since you hate vBulletin's implementation, maybe a copy button that only copies/paste highlighted text. | |
I copied/pasted the html code for my member badge into my vBulletin web site but it doesn't work. All I get is the html code and not the badge image. What's wrong? | |
Re: If x is a float or double printf() will think its an int because of the %d and try to print it accordingly. On 32-bit compilers the size of an int is 4 bytes while the size of a float is 6 bytes. You might even get strange results for … | |
Re: It is better to pass the ofstream as a parameter instead of making it a global because globals are generally frowned upon. Pass by reference, you can't pass it by value. | |
Re: Deposit $10,000.00 USD in my paypal account and I'll write it for you. :) | |
I have to get me one of these :) http://www.youtube.com/watch?feature=player_embedded&v=WOoUVeyaY_8 | |
Re: > ifstream in( ); line 36: Inside the parenthese you put the full path to the filename. But you have that line in the wrong place ~~~ do { if( !fd.attrib & _A_SUBDIR ) { ifstream in(findPath+fd.name); while( getline(in, line)) { // blabla } } } while( _findnext() ); ~~~ … | |
Re: The links don't work. Its better to just use he Advanced Editor (link at the underneath the message editor) and upload the pictures to your thread. [code] #include <iostream> #include <string> [/code] Those are c++ header files, not C. You can't compile that program with a C compiler. | |
Re: > The reason of this behaviour is that the readfile read the file until get NULL I think you misunderstood. ReadFile() reads in binary mode, the same as fstream.read() or in C fread(). You tell it how many bytes to read and it will read that many bytes, or until … | |
Re: line 29: should be %d, not %s because newrep[ndigit] is a single numeric digit, not a string | |
Re: The only file you need in the test project folder is the *.dll. Actually, you can put it any of the folders listed in your PATH environment variable, such as c:\windows\system. As for the *.h file(s), just put the full path to where they are located in the include statement, … | |
Re: If you google for that error message you will get some help, for example this link: http://www.west-wind.com/weblog/posts/2012/Jan/13/Unable-to-cast-transparent-proxy-to-type-type | |
Re: The loop is wrong ~~~ while( fscanf(...) > 0) { printf ("Integer read = [%d]\n",i); } ~~~ |
The End.