15,300 Posted Topics

Member Avatar for Jononomous

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.

Member Avatar for miker00lz
0
832
Member Avatar for Tinee

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.

Member Avatar for Ancient Dragon
0
285
Member Avatar for AnonymousX

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 …

Member Avatar for Ancient Dragon
0
263
Member Avatar for beck0760

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 …

Member Avatar for AndreRet
0
332
Member Avatar for lochnessmonster

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.

Member Avatar for Red Goose
0
110
Member Avatar for himanshusharma

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.

Member Avatar for josephbeluan
0
203
Member Avatar for packluv12

>>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 …

Member Avatar for jkoske
0
118
Member Avatar for theoryforlife

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 <= …

Member Avatar for theoryforlife
0
249
Member Avatar for jugadengg

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 …

Member Avatar for gerard4143
0
227
Member Avatar for gaviel080990
Member Avatar for Ancient Dragon
0
119
Member Avatar for biancaW

>>please check this code : 1. its [icode]int main()[/icode] never void main() 2. What exactly do you want us to check?

Member Avatar for vinayakgarg
0
151
Member Avatar for Jessurider
Member Avatar for Sundayy

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 …

Member Avatar for Sundayy
0
169
Member Avatar for Dadkhah

>>//#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 …

Member Avatar for Dadkhah
0
251
Member Avatar for lochnessmonster

When you create a DLL project the IDE cretes two *.cpp files, not one. DllMain() is generated in dllmain.cpp.

Member Avatar for Ancient Dragon
0
42
Member Avatar for alex55

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] …

Member Avatar for alex55
0
226
Member Avatar for goody11

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.

Member Avatar for Ancient Dragon
0
93
Member Avatar for surfer2009

>>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. …

Member Avatar for Ancient Dragon
0
90
Member Avatar for altXerror

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(); } …

Member Avatar for pseudorandom21
0
189
Member Avatar for VasquezPL

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 …

Member Avatar for VasquezPL
0
1K
Member Avatar for buniferous
Member Avatar for Ancient Dragon

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 …

Member Avatar for jlego
1
195
Member Avatar for becool007

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.

Member Avatar for Ancient Dragon
0
96
Member Avatar for arguav74

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. …

Member Avatar for Ancient Dragon
0
368
Member Avatar for babafemi

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.

Member Avatar for Ancient Dragon
0
105
Member Avatar for akase2010

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 …

Member Avatar for akase2010
0
140
Member Avatar for welp

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.

Member Avatar for Ancient Dragon
0
297
Member Avatar for Kaushalya

[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]

Member Avatar for zwatsu13
0
14K
Member Avatar for six_sic6
Member Avatar for Dani
0
135
Member Avatar for surfer2009

[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 …

Member Avatar for Ancient Dragon
0
91
Member Avatar for sowjanya.y
Member Avatar for chrishea
Member Avatar for lochnessmonster

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() …

Member Avatar for Ancient Dragon
0
96
Member Avatar for Nandomo

Maybe you should be using [URL="http://pdcurses.sourceforge.net/"]PDCurses [/URL]instead of NCurses

Member Avatar for Ancient Dragon
0
103
Member Avatar for begineer

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. …

Member Avatar for Ancient Dragon
0
213
Member Avatar for emreozpalamutcu

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]

Member Avatar for Dingbats
0
111
Member Avatar for jaepi

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.

Member Avatar for sfault
0
634
Member Avatar for merlin786

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 …

Member Avatar for Ancient Dragon
0
118
Member Avatar for triumphost

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 …

Member Avatar for Ancient Dragon
0
384
Member Avatar for ndowens

Maybe he's thinking [URL="http://www.prototypejs.org/api/function"]Java[/URL]

Member Avatar for jonsca
0
181
Member Avatar for HeartBalloon

>>char[] Customers::passName(Customers c){ It is customary to code that using *, not [], as shown in the previous ^^^ post.

Member Avatar for gerard4143
0
93
Member Avatar for mohamed_nasr
Member Avatar for arshi9464
Re: loop

One way would be to use non-standard _kbhit() from conio.h [code] while( !_kbhit() ) { // do stuff here } [/code]

Member Avatar for arshi9464
0
90
Member Avatar for MooGeek
Member Avatar for PerplexedWon

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 != …

Member Avatar for PerplexedWon
0
779
Member Avatar for Adami

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 …

Member Avatar for Ancient Dragon
0
171
Member Avatar for lexusdominus

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 …

Member Avatar for lexusdominus
0
211
Member Avatar for Zvjezdan23

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 …

Member Avatar for KKR_WE_RULE
0
365
Member Avatar for WaltP

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 …

Member Avatar for Dani
1
158
Member Avatar for Kumar_cr09

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 = …

Member Avatar for Ancient Dragon
0
146

The End.