15,300 Posted Topics
Re: If the strings are always in that exact format than this should work. [code] int main() { char s1[] = "www.clickajob.co.uk%2Fprofiles%2F316%2F6%2F|a/TLT10911641168.google"; char s1a[50] = {0}; char* pos; pos = strchr(s1,'%'); *pos++ = 0; strcpy(s1a, s1); pos = strchr(pos,'/'); strcat(s1a,"|"); strcat(s1a,pos+1); printf("%s\n", s1a); return 0; } [/code] | |
Is it just my browser IE7 on Vista ? I don't see any submenus when I hover the mouse over the main menus such as [b]Software Development[/b]. I deleted temporary internet files but that didn't help. | |
| |
Re: put a print statement at the beginning of the function to print out the value of height_rect and width_rect. Are they what you would expect? If not then the problem is elsewhere in your program. | |
Re: [QUOTE=ithelp;620611]Install VC++ Create a MFC application it is quite easy.[/QUOTE] The current free compiler VC++ 2008 Express does not support MFC. You will have to buy it do get MFC. VC++6.0 does support MFC ok but that is a terrible compiler because it doesn't support the C++ language very well … | |
Re: Lord of the Rings was written by who? Blizzard possibly? Why don't you ask them? Also, thanks for bumping a 2-year-old thread :) | |
Re: The open flags do not set the file permissions -- they are two completly different things. After copying the file you have to change the permissions. [URL="http://www.faqts.com/knowledge_base/view.phtml/aid/24443"] Here's how to do it[/URL]. | |
Re: line 10 doesn't allocate room for the null terminator. Add 1 to the size() value. | |
Re: I really don't know a hill of beans about blogs either. I thought a blog is just a plain text file which is posted on someone's web site, such as DaniWeb's blog board. You could write it with Notepad.exe (on MS-Windows) if you want to. Or, is Garud actually talking … | |
Re: Here is how I would allocate A [code] const int maxelms = 4; int i; double** A; // allocate the first dimension A = calloc(maxelms, sizeof(double *)); // now allocate each of the other dimensions for(i = 0; i < maxelsms; ++i) { A[i] = calloc(maxnums, sizeof(double)); } [/code] | |
Re: just write it multiple times using a different filename each time. Or write the first file then call os-specific command to make additional copies. | |
Re: use the mod operator % to get a value from 0 to some upper-limit. For example to get a random number between 0 and 100 [icode]int num = rand() % 100;[/icode] Much more information [URL="http://www.cprogramming.com/tutorial/random.html"]about it here[/URL]. | |
Re: >>For an example look at this site: [url]http://svenskaspel.se/pl.aspx?PageID...&parentid=4373[/url] That link is useless to most of us because its not in English. | |
Re: lines 19-23 can be rewritten like below because it isn't necessary to test for eof directly. [icode]while( Infile >> N >> A >> G) [/icode] delete line 63 if you recode as above Other than the above, I don't know what kind of help you want. | |
Re: [URL="http://en.wikipedia.org/wiki/Dijkstra's_algorithm"]Here[/URL] is some pseudocode code | |
Re: The header file and line 62 of the *.cpp file are incorrect. The parameter you have declared is just one single character -- I know of no names that consist of a single character. It should be this: [icode]void DisplayName (char* pFullName);[/icode] or this [icode]void DisplayName (char pFullName[]);[/icode] | |
Re: Try redrawing the original graph with the same color as the background so that the lines will get erased, then draw the new graph. | |
Re: Dr. Who is IMO the all-time best sci fi series ever shown on TV, even outshining Star Trek. The movie made by 20th Century Fox Television, however, was a disaster. As for the authors: Dr Who -- I don't know who can be considered the author because I think it … | |
| |
Re: yes. add [icode]cin.get()[/icode] just before returning form main(). | |
Re: >>I was wondering how can I make a precise delay that is shorter then 1ms depends on the operating system. Neither MS-Windows nor *nix will allow you to do that because neither operating systems are real-time os. There are a lot of other programs that have to be executed as … | |
Re: What you want is a simple line drawing program. How to do it depends on the operating system because each one is different. And all of them are somewhat complex. | |
Re: >>scores[26] == scores[26]<24 ? in : in; I have no clue what that is trying to do There are 8 sets of values that the scores can fall into, not 32. So all you need is an array of 8. When you read a score just use a series of … | |
Re: you have to allocate memory for pointer a. The way you have it written pointer a just points to some random memory location that your program probably does not own. [code] char *p = "asd"; char * a [color=red]= new char[strlen(p)+1][/color]; [/code] The second reason your program doesn't work is … | |
Re: [QUOTE=williamhemswort;618487] [B]<iostream.h> was declared deprecated[/B][/QUOTE] More about that [URL="http://members.gamedev.net/sicrane/articles/iostream.html"]here[/URL]. | |
Re: >>i believe it better than winsock so i really dont care. No it isn't -- the code you posted IS using winsock, it does not replace it. There is nothing wrong with using libraries that make your life a little easier, all programmers do that. >>everything i've learnt, ive learnt … | |
Re: depends on the hardware that linex is running on -- if its on an 80x86 or Pentium box then there will be no difference at all. Linex (or unix) is supported on a lot of other platforms and the assembly instructions for those will be very different than on ms-windows. … | |
![]() | Re: [list] [*]RegOpenKey() to open the key [*]RegEnumValue() to read the value directly into the string [*]CloseKey() to close the key object [/list] [URL="http://msdn.microsoft.com/en-us/library/ms724875(VS.85).aspx"]Registry Fucntions here[/URL]. [URL="http://msdn.microsoft.com/en-us/library/ms724256(VS.85).aspx"]Example program here[/URL] ![]() |
Re: Since you didn't post any code we can only guess that you are attempting to write back to the file that you read from. You can't do it that way. Open a different file for output then read a character from input file and write the morse code to the … | |
Re: read a random number into a float between the range of 0 and 100, then divide by 100 to get a number from 0 to 0.9999 | |
Re: There is never ever an acceptable use of [b]goto[/b]. I know teachers who give an F for a program that uses it, and the companies I worked for absolutely forbid it. | |
Re: $270.00/credit hour :icon_eek: I have some shares in the Golden Gate bridge I'll sell you for half that much. | |
Re: you could set a timer and close the dialog box in the OnTimer() event handler. There may be a couple other options: (1) send a WM_CLOSE message from another window or (2) click the X button in the upper-right corner, assuming you have not removed that too. | |
Re: what programming language. You can ask questions right here on DaniWeb. Do you want a web site that lets you type in a program and see if it will compile? | |
Re: A macro is something that is expanded by the compiler's preprocessor. A constant is like a normal variable but whose value can not be changed, nor is a constant affected by the preprocessor. | |
Re: you mean people old enough to post on the internet still have a nanny? Isnt' a nanny just another word for a baby sitter? | |
Re: Can't speak for others but those kind of ads don't bother me at all and I'll occasionally click on one to see what its about. I don't have any clues about your other questions. | |
Re: The most irritating and longest bug to fix was in a MS-DOS 6.X program. I had my own multi-threading kernel and several threads. One thread would set the value of a global integer and another thread would read it. One of the threads (foreground screen) would occationally lock up and … | |
Re: where did you get that library ? The author of the lib should have provided you with the needed non-standard header files. | |
Re: A KVM switch works very well, I've used it to control four computers with one keyboard, one monitor and one mouse. But don't expect them to last forever -- they wear out eventually and you will have to buy another one. | |
Re: >>Is there any classes/ built in methods for this. No >>Is this very difficult things to do in C++ ? Depends on your experience. What is easy for me might be very difficult for you. >> Do I need any Add-In:s to C++ etc.. to be able to do this. … | |
Re: >> Where does WinAPI fit into all this That is the Windows operating system functions. OpenGL, DirectX, etc are wrappers around win32 api functions. You can do windows graphics without OpenGL or DirectX, but you can't do OpenGL without the WinAPI. | |
Re: Here is the c++ way of doing that [code] #include<iostream> #include <string> #include <vector> #include <sstream> using namespace std; class X { public: string a; string b; string c; }; int main() { string abc = "as,df,ert:we,rt,yu:ee,rr,tt"; vector<X> vtr; X xx; size_t pos; while( (pos = abc.find(':')) != string::npos) { … | |
Re: Welcome to DaniWeb. There are several old-timers here, so you will fit right in. >>Am I in the right place? Absolutely :) | |
Re: Welcome to DaniWeb, Crabby. [URL="http://www.programmingforums.org/member2600.html"]Meet Grumpy[/URL], also from you part of the planet. | |
Re: This is the day that Americans honor our dead soldiers for the ultimate gift of life that they gave us. We have outdoor barbecues, drink beer, have large televised parades, and visit fallen soldiers at their grave sites. | |
Re: >Opps, I just realized I posted this in the C forum ;) I thought I was in C++. You posted in the right place. It doesn't matter what compiler you use, its the code not the compiler that determines which board to post on. [edit]Oops! I see the cout now. … | |
I tried to upload a *.zip file in [URL="http://www.daniweb.com/forums/post608544.html#post608544"]this thread[/URL] (post #28) and it failed. I thought zip files were acceptable. | |
Re: [URL="http://www.datareel.com"]DataReel.lib[/URL] is free and portable to both *nix and MS-Windows. It has a huge amount of functions to do networking and other stuff. |
The End.