15,300 Posted Topics
Re: In addition to what ^^ said you can't just send a byte out the serial port. The port has to be set up first with stop bits, data bits, parity and baud rate and those must match whatever is on the other end of the serial port. | |
Re: line 18 is wrong -- the array does not have 6 elements, only 5, which are numbered 0,1,2,3 and 4. There is no 5th element. The parameters to the function in lines 5 and 27 to not agree. | |
Re: That can not be returned from a dll because memory allocated in a dll can only be destroyed in the DLL, and memory allocated in an application program can only be destroyed in the application program. The two are not compatible. A better way to do it is to add … | |
Re: Entry level programmers are not expected to be as competent as those with a year or more experience. Just show your prospective employers that you know the basics and you will be oki. As for the number of languages, just concentrate on one or two so that you can gain … | |
Re: The answer is no because variable names can not start with a numeric digit. But in c++ you could create a <map> between a digit and something else such as an integer counter. | |
Re: Just rename the *.bak files to *.c (or whatever the original file name is). *.bak files are identical duplicates of the original. You will most likely have to exit your compiler's IDE before doing this. | |
Re: >>a new array that needs to allocated dynamically Your program has not done that. And the loop on lines 15 - 19 is useless, just delete it. First, call new to allocate an array of the same number of integers as the original array. Next, use a for loop that … | |
Re: You need two nested loops, not just one. The first loop counts from 0 to num then the inner loop counts from 0 to the value of the outer loop, something like this [code] for(int i = 0; i < num; i++) { for( int j = 0; j <= … | |
Re: There is no upgrade to that compiler -- it has been dead and buried for quite some time now. I think using mangled names is common to all linkers -- all Microsoft compilers do that too. It's beyond the scope of a linker to know the unmangled name. The mangled … | |
Re: This is a C program, not C++, so Narue's thread will not work. | |
Re: >>please check this code : 1. its [icode]int main()[/icode] never void main() 2. What exactly do you want us to check? | |
Re: That zip file can not be opened by WinZip. | |
Re: Post the code you have tried. If you don't know where to start, then start here [code] #include <iostream> using std::cin; using std::cout; int main() { // code goes here } [/code] Write the program just a little bit at a time and you won't get overwhelmed about the program's … | |
Re: >>//#define CreateFile CreateFileW; // I added this line, for solved this error: error C2664: 'CreateFileW' : cannot convert parameter 1 from 'char *' to 'LPCWSTR' DON'T DO THAT! CreateFile is declared in windows.h. Fix the error instead of trying to code around it. If you want to use char* then … | |
Re: When you create a DLL project the IDE cretes two *.cpp files, not one. DllMain() is generated in dllmain.cpp. | |
Re: One way to do it is to put all the code to read and write a file in a function, then call that function twice from main() with the name of the input file eacj time, something like below except you should use a different name for the function. [code] … | |
Re: You have to capture mouse events, which will give you the x and y coordinates of the mouse. Then just test those coordinates against the area of the window you are interested in to see if the mouse clicked inside or outside the rectangle. | |
Re: >>fd=open("abc.c"); That file is neither object file or executable file. Its a C script file. On MS-Windows you can easily tell the difference between object and executable by its file extension. On *nix executable files do not normally have extensions, but you can identify them by the file permissions mask. … | |
Re: lines 1 and 10 -- you must use a pointer there, e.g. [icode]void Password(char* password)[/icode] Since the character array is declared inside the Password() function, the function needs no parameters. Just [icode]void Password()[/icode] Then in main() all you have to do is call it [code] int main() { Password(); } … | |
Re: This is not c++ -- it is CLR/C++ which is another language that was derived from c++. And yes, it is very easy to add the console code to the CLR project -- call the code in the button or menu event handler. The console code won't be able to … | |
According to [URL="http://articles.cnn.com/2010-07-23/tech/internet.addresses_1_internet-numbers-ip-addresses-ipv6?_s=PM:TECH"]this article[/URL] the internet will run out of IP addresses some time in 2011. Will the internet stop working then? Most likely not, its just that no new ip address can be assigned until IPv6, for "version six" is adopted, and will add more digits to the ip … | |
Re: You can tell if you are trying to compile a C or C++ program by the file extension. *.c compiles as C code, while *.cpp compiles as C++ code. | |
Re: Your compiler did not lie to you -- variable low is being used before it as initialized with a value. At that time the variable contains just some random value, whatever was left in the memory location. How to you fix that? Just initialize it when it is declared, e.g. … | |
Re: I heard that same argument 25 years ago. Yet there are still a lot of people and companies who need programming work but either don't want to do it themselves or don't have the time. freelance jobs are secure in the forseeable future. | |
Re: what do you mean by "it won't work"? You need to be more specific. Do you take your car to auto repairman and simply tell him "my car is broke, fix it please."? Of course not, you have to tell him what you thnk is wrong and what the symptems … | |
Re: My guess is that you have a project that contains both a.cpp and b.cpp, then you have included a.cpp in b.cpp. You can't do that. In b.cpp remove the line that includes a.cpp. | |
Re: [code] int main() { string str = "0x0002,A5651QPR87GBZ094RTF52,D,A,000001,ABC ,10000.00 , EOT"; string word; stringstream stream(str); while( getline(stream, word, ',') ) cout << word << "\n"; }[/code] | |
Re: Looks solved to me :) Maybe you just need to refresh your browser. | |
Re: [URL="http://en.wikipedia.org/wiki/EXE"]Here [/URL]are some hints how to recognize the kind of executable files, but that isn't completly reliable on iteself. Just because the first two bytes of a file contain a certain signature doesn't mean it is an executable file -- it could be a plain text file or some other … | |
Re: [URL="http://www.zlib.net/"]zlib [/URL]with source code | |
Re: One purpose I use pointers to pointers is so that other functions can allocate memory for a pointer declared in another function. This is especially useful in building linked lists, which you will eventually discover during your studies. [code] void foo(char** pointer) { *pointer = new char[255]; } int main() … | |
Re: Maybe you should be using [URL="http://pdcurses.sourceforge.net/"]PDCurses [/URL]instead of NCurses | |
Re: Your compiler is a 16-bit compiler that only runs under MS-DOS and knows nothing about long file names, such as names with spaces. It will be impossible that compiler to create a new directory that contains spaces like "Program Files" or names longer than 8 characters and 3 character extension. … | |
Re: google for "windows forms singleton" and you will find [URL="http://geekswithblogs.net/chrisfalter/archive/2008/06/06/how-to-create-a-windows-form-singleton.aspx"]this thread[/URL] | |
Re: probably because you have not defined [b]sem_t[/b] -- I never heard of it. If its an integer then assigning NULL to it is incorrect -- NULL is used for pointers, just use 0 to initialize integers. | |
Re: Salary depends on where you live. What a programmer does all day depends on the job. Is he the only programmer in the company? Or is he a member of a team ? Its my experience that the biggest part of the job is program maintenance -- fixing bugs and … | |
Re: MS-Windows only runs on x86 or Intel based computers. Therefore win32 and x86 are the same thing. >> If I chose x64, it doesnt run an any computer that doesnt have a 64bit OS.. If I press x32, It doesnt run on a x64 computer I use 64-bit Windows 7 … | |
Re: Maybe he's thinking [URL="http://www.prototypejs.org/api/function"]Java[/URL] | |
Re: >>char[] Customers::passName(Customers c){ It is customary to code that using *, not [], as shown in the previous ^^^ post. | |
Re: Did you code a main() function? | |
Re: One way would be to use non-standard _kbhit() from conio.h [code] while( !_kbhit() ) { // do stuff here } [/code] | |
| |
Re: For each letter in the source string you have to check each character in the vowels or conconants string to see if the letter in the source string matches one of those. [code] // count vowels times = 0; for(; *str != '\0'; ++str) { for(vowelsptr = vowels; *vowelsptr != … | |
Re: Run the program with your compiler's debugger and find out why *.c2 is not being created. Possibly the function is not even being called. Since includes can be nested -- that is, one include file can contain other include files -- you will need the function that processes includes to … | |
Re: using vc++ 2010 there are a couple options 1. Create a win32, Win32 Project. That will generate a shell of a program in which you will have to code all the window stuff using pure win32 api graphics functions. [URL="http://winprog.org/tutorial/"]Here is a tutorial [/URL]to get you started with that. Be … | |
Re: loop through the string and count the number of white spaces -- isspace() macro will tell you if it is a white space or not (white space is space, tabs and something backspace characters). Then subtract that from the total string length. Or just count everything except white space and … | |
Re: Agree, I think that problem has been reported before, not long after those two buttons were introduced. Once the up or down button has been pressed there is no way to cancel the vote, such as when you pressed the wrong button. It's probably one of those things low on … | |
Re: I suppose you could repeatedly call time() and exit the function when the desired amount of time has expired. [code] void foo() { time_t t1, t2; t1 = t2 = time(); // starting time while( (t2 - t1) < 10 ) // 10 seconds { // do something t2 = … |
The End.