15,300 Posted Topics
Re: >>8000fe80 why this code is not working for this hexa decimal address Data overflow. On line 73 add cin.clear() to clear out the errors. | |
Re: Turbo-c console program? No. You have to use the font size that is built into your computer. To change font sizes requires a graphics program, and then you have to either create the fonts yourself of get the fonts from someone else. | |
Re: You can't insall turbo c on Windows 7. | |
Re: There are a couple ways to do it. open file 1 for input open result file for output read each line in file 1 and write it to the result file. getline() will help you with that. After done, close file 1 -- leave result file open Now do the … | |
Re: Failing to refresh the page before making changes causes a lot of problems. I've seen entire paragraphs disappear because I forgot to refresh before editing a post. | |
Re: Are you trying to wite a program with Notepad then compile it with VS iDE? The easiest was is not to use Notepad, but to do all your work is VS iDE. [Here ](http://msdn.microsoft.com/en-us/library/e6w9eycd(v=vs.80).aspx)are a few articles to get you strted. | |
Re: when the string is found, check the character immediately before and after to see if it is a space. If not a space, then the string is not what you want. | |
Re: There are a number of ways that a valid Windows license may become invalid. One way is to install a new motherboard in the computer or make other significant hardware changes. I've had that happen to me a couple times. The telephone numberf Ummn referred to is in the error … | |
Re: Read the file one word at a time, saving the words in another file except replace the 5th word (or whatever number it is) with the new word. You need two files, an input file and an output file. | |
Re: The GUI will depend on operating system. [Here's ](http://www.winprog.org/tutorial/)a tutorial for win32 api (MS-Windows). | |
Re: worked for me using vs2013 Enter values for x1 x2 y1 y2 1 2 3 4 5 Distance from first point to origin :3.16228 Distance from second point to origin :4.47214 Distance between the two points:1.41421 Press any key to continue . . . | |
Re: I would think professors would encourage students to learn how to do research -- learn how to use google to find answers to questions. Afterall, that's what happens on-the-job. That doesn't mean find someone to do write their programs for them, but to ask questions, something like what DaniWeb encourages. … | |
Re: fn is a pointe to a function. It is set on line 11 but never actually used for anything. That is what your compiler is warning you about -- you could just delete line 11 with no loss. | |
Re: >>please help me...if anybody is having any idea Help you do what exactly? I didn't see a question in your post. | |
Re: Your program might compile but does the compiler produce any errors or warnings? You have to fix them befre you can run the program. I spot at least one error -- line 13, functions have to be declared before they can be called. | |
Re: Please don't refer to people you don't know as "dear". No one here is your sweatheart. Did you read [this thread?](http://www.daniweb.com/software-development/cpp/threads/70096/c-books) | |
Re: That's not C code -- looks more like pascal or java.' At any rate, in C/C++ you have to declare variables before they can be used. so if you want to use a vector then you have to incude the vecor heade file #include <vector> using std::vector; | |
Re: cin >> buffer will auto stop getting keys from the keybord when cin counters the first white apace (space, tab or '\n'). Buffer will never contain any of those white space characters, so your loop on line 13 ill never find one. If you want buffer to include all white … | |
Re: Is [this](http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx) what you mean? | |
Re: This version creates the right path [code] int main(void) { FILE *fp = fopen("/home/caars/Desktop/caars.properties.txt", "r"); char *word; char *fname ="mytest.txt"; //filename char line[500]; char *find; char *fpath; if(fp==NULL) { printf("Failed to read input file\n"); return EXIT_FAILURE; } printf ("file read!!! \n"); while(word = fgets(line,256,fp)) { find = strstr(word,"/home/"); fpath=find; if( … | |
Re: LPCWSTR is a ponter to a wchar_t* string. typecasting like you do on line 18 doesn't work. You have two choices: (1) turn off UNICODE strings and use just standard ascii strings or (2) `CreateFolder(L"E:\\DATA");` Note that the L in front of the string literal makes it a wchar_t* instead … | |
Re: maybe something like this: Replacing the \* with your own criteria IF EXITS(select \* from tablename where <clause>) THEN ' increment counter ELSE ' insert new row END IF | |
Re: what language? In C and C++ (probably otheers too) you can call win32 api functions to get a handle to another application. But if start App B by calling CreateProcess() then it will give you the necessary handle. | |
Re: read the questions here about C programming to get good ideas. You might just learn something new you didn't know before. | |
Re: >getch() is not part of the C standard. Use getchar(); instead. Why use either one? cin.get() is already in <iostream> so use it instead of adding more C-code to the program. . | |
Re: what in the world is line 41 supposed to do -- it makes no sense??? Line 42 is pretty much meaningless too. Very simple to count the number of characters in the array [code] int count = 0; for(int i = 0; i < size; i++) { if( a[i] != … | |
Re: lines 30 and 38: result() is not a function that has been previously declared. line 62; Functions can only return one variable, not two. It seems you have misunderstood the assignment. incr10() has two parameters passed by reference, not by value. Do not use the \* when passing by value. … | |
Re: Looks like you are attempting to create a connection, nsert some data, and select somore other data all in one statement. Can't do that. You need to std a tutorial that teaches you the correct method of doing those things. [Here](http://www.homeandlearn.co.uk/NET/vbNet.html) is a very good one to get you started … | |
Re: line 2: what do you expect prinitf() will display? first is just an ininitiaolized array of random caracters which may or may not contain '\0' which printf() looks for to find the end of the array. line 4: what will happen if I enter more than 15 characters on line … | |
Re: think how you would do it with pencil and paper. You start out wit $1,000 then simply subtract the amunt of purchses. | |
Re: what operating system is the computer running? I used to have lots of corrupt files with all versions of MS-Windows XP and older -- have not had such problems with Windows 7 and 8. | |
Re: >>Ok - there's nothing like a BIG challenge to start off my exploration into programming HaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHa HaHaHaHaHaHaHaHaHaHaHaHa HaHaHaHaHaHaHaHaHaHaHaHa Sorry, but I can't stop laughing! You don't know a thing about programming, yet you want to do WHAT! HaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHaHa I really should move this into Geek's Lounge because its so funny … | |
Re: tutorial [here](http://dev.mysql.com/doc/refman/5.0/en/tutorial.html). You are expected to already know fundamtals of c++ language. | |
Re: Your first task will be to learn the Sequential Query Lanaguage (sql). That is the language all SQL-compliant database servers use. There are many free tutorial online, such as [these](https://www.google.com/?gws_rd=ssl#q=sql+tutorial+for+beginners). Most, if not all, modern programming languages support SQL so it doesn't really matter which language you use. | |
Re: >everyone ask me to do this in C++ using getline(), fgets() is the C equivalent of c++ getline() (almost anyway). | |
Re: do all clients have the same printers? Do you have the same printer as the clients? | |
Re: >Posts contributed to the community immediately become the property of DaniWeb upon submission. See [this link](http://www.daniweb.com/home/tos) | |
Re: Well, if your program is anything like the one below then the strings may not be anywhere in the file because std::string contains a pointer to where the string is located in memory, and writing out the class does not auto write out those strings. In this case you just … | |
Re: That's because "%x" is an unsigned hex 32-bit integer on 32-bit compilers. See [this article](http://www.cplusplus.com/reference/cstdio/printf/). | |
Re: I've always liked [this Scribble tutorial](http://msdn.microsoft.com/en-us/library/aa716527(v=vs.60).aspx) | |
Re: have you tried [goodle](https://www.google.com/?gws_rd=ssl#q=c%2B%2B+library+management+system)? | |
Re: In copy() you need to null-terminate the string at line 50 because that while statement doesn't do it. The main problem is line 16, it's missing required parentheses. `while ( (len = getline(line, MAXLINE)) > 0)` line 31-38 are also incorrect. The only way to get EOF is to press … | |
Re: [QUOTE=tux4life;888175]With me your code compiles (I'm using MinGW), but when running, your program will crash :)[/QUOTE] That's because it contains illegal code for *nix and MS-Windows operating systems. Its not even valid code for MS-DOS 6.X and older. | |
Re: line 11. sizeof a pointer always returns 4 on 32-bit compilers. There is no way for the compiler to determine the length of the data to which the pointer addresses. Also about that same line and line 18. line 18 creates a pointer to a 1-byte string, yet on line … | |
Re: line 23 is looking for the end of the first word, but then you display the entire line on line 27. before the break on line 25 you need to truncate the string at the end of the first word. First call std::string's find() method to get the position of … | |
Re: If those are the only command-line options why do you need Boost? That's like swatting a fly with a sludge hammer. |
The End.