15,300 Posted Topics

Member Avatar for Alochai
Member Avatar for Alochai
0
1K
Member Avatar for Hani1991

> in other words be muslim). Wong. Be Christian. If you don't believe in Jesus Christ then you will most likely burn in Hell for all eternity (there are a few exceptions).

Member Avatar for Reverend Jim
-5
1K
Member Avatar for devender22

> ave a problem in which i want to declare two pointers of undefined length....so i don't want to use malloc... you have to use malloc() to allocate space in which to store the characters received from scanf(). If you don't want to use malloc then you have to declare …

Member Avatar for Ancient Dragon
0
122
Member Avatar for shsh111
Member Avatar for Taywin
0
102
Member Avatar for jamburn

Which flavor of BASIC will they use? The current one is VB.NET and the compiler is available for free at[ this link](http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-basic-express). [Here](http://www.homeandlearn.co.uk/net/vbnet.html) is a brief introduction tutorial you can study

Member Avatar for jamburn
0
219
Member Avatar for complete
Member Avatar for Ancient Dragon
0
80
Member Avatar for shsh111
Member Avatar for baby_c

You use the pointer operator -> to access structure members. See line 18 in the code below for example. [code] struct person { char lname[80]; char fname[80]; }; struct person* foo() { struct person* p = malloc(sizeof(struct person)); <snip> return p; } int main() { struct person* p = foo(); …

Member Avatar for Banfa
0
760
Member Avatar for Reverend Jim

> Blame a medical condition rather than a corrupt system. What system do you mean? Who says its corrupt? Just because you think so doesn't make it so. And what do you think the President should or can do about it? There is little anyone can do to keep someone …

Member Avatar for Reverend Jim
1
394
Member Avatar for sivavendra
Member Avatar for ireshagun
0
151
Member Avatar for np complete

> Is there any built in function? No. There are probably image libraries that you can get, some free and others not free. I never tried to do that so I don't know.

Member Avatar for mike_2000_17
0
254
Member Avatar for kirenemook12

how it works depends on the hardware. If you buy a small robot then you will have to read their programmer's documentation to find out how to interface a computer with it. If you build your own then I suppose you can design the commands yourself. You might want to …

Member Avatar for mike_2000_17
0
275
Member Avatar for plike922

[QUOTE=ArkM;671319]In essence, char type in C (but not in C++) is a very short int, that's all.[/QUOTE] I think you will find char data type is the same in both c and c++.

Member Avatar for I_m_rude
0
529
Member Avatar for phorce

Two problems with that code 1. theData in Data() is just a local variable, so line 12 us useless, does nothing. 2. arrays declared inside function can not be returned from the function, attempting to do so will cause sig faults, as you have found out. To correct the problem, …

Member Avatar for Ancient Dragon
0
161
Member Avatar for shkr

It depends on how the log file was written. If it is in binary mode and written with fwrite() then you can use fread() to read each record directly into the structure. Otherwise if its text mode and written with fprintf() then use fgets() to read it and pars the …

Member Avatar for Ancient Dragon
0
161
Member Avatar for milindchawre

> I should mention that there is no function in the standard library for deleting files Yes there is -- [remove()](http://www.cplusplus.com/reference/clibrary/cstdio/remove/) > The same applies to renaming a file. See above link

Member Avatar for Ancient Dragon
0
303
Member Avatar for manishanibhwani

> can anyone explain ...at what time memory is allocated for variables... Intel based computers -- All local variables are actually allocated by the compiler immediately upon function entry, even the variables that are declared later within the function. (You will see this if you let your compiler produce an …

Member Avatar for deceptikon
0
188
Member Avatar for sillyboy
Member Avatar for BigHeart
Member Avatar for darkagn
0
184
Member Avatar for newbie14

>>exactly every second I need to call a particular function Neither MS-Windows nor *nix is that accurate, actual time may be +/- a few milliseconds, depending on what else the operating systems and other processes are doing.

Member Avatar for newbie14
1
2K
Member Avatar for Sendy Hipo

> note : sorry for the bad english Don't underestimate your command of Engligh language -- its much better than many native English writers I've seen.

Member Avatar for Sendy Hipo
0
143
Member Avatar for ScottFountaine

Is userip char\*? If yes, then to put a space before it you will have to move current text right one character to open up the byte in which to put the space. For example, if userip originally contains "255.255.255" then you will call memmove() to shift all characters right …

Member Avatar for ScottFountaine
0
130
Member Avatar for reyesg

can you post some same data? Need to know what's in the file and how its formatted.

Member Avatar for reyesg
0
115
Member Avatar for WaltP

I tried that link, my entire screen turned white, pressing Esc did nothing, so I killed the browser in Taek Manager.

Member Avatar for Ancient Dragon
0
219
Member Avatar for jigarsangoi

The first thing to do is design the database. What database engine do you want to use? MySQL, MS-Access, Orical, ... there are dozens of them. Do you know SQL? If not then you will have to study/practice it. There are lots of books on amazon.com that help you with …

Member Avatar for Ancient Dragon
0
84
Member Avatar for senergy

Have you seen [URL="http://tangentsoft.net/mysql++/doc/html/userman/tutorial.html"]this example program[/URL]? Put an if statement around line 21 to insure the query succeeded.

Member Avatar for godinac
0
490
Member Avatar for rithish

why templates? So that you don't have to write different functions that all do the same thing but with different data types. That's how its done in C language. For example if I need a function that returns the sum of two numbers but it need to handle int, float, …

Member Avatar for mike_2000_17
-1
91
Member Avatar for manishanibhwani

> int k=12; Now try this and you will see different behavior static int k=12;

Member Avatar for manishanibhwani
0
105
Member Avatar for manishanibhwani

Its not that simple -- see[ this article](http://en.wikipedia.org/wiki/Floating_point)

Member Avatar for sepp2k
0
115
Member Avatar for Enrique Nivasch

function pointers can only point to static class methods or global c-style functions. You will have to make PrintIt() a static method if you want to do that.

Member Avatar for DeanMSands3
0
342
Member Avatar for rithish

variable a is an single dimensional array which will hold only one string. What you want is something like this: char a[20][30]; which is a 2d array that holds up to 20 strings, and each string can contain up to 30 characters (29 + null terminator).

Member Avatar for rithish
0
2K
Member Avatar for shanki himanshu

> use strlen Maybe, but maybe not. Depends on what you want, strlen() and sizeof() may return different values such as when the buffer contains embedded '\0' characters.

Member Avatar for Banfa
0
549
Member Avatar for laavanya

Do you mean which compilers you should use? Of course before you can write a program you have to know something about what the program is to do. For example you can't write a program to fly a ship from Earth to the moon without knowing something about astronomy. You …

Member Avatar for rithish
0
144
Member Avatar for mahnaz0098

There is no such thing as "simple" example. You have to use win32 api [Communications Functions](http://msdn.microsoft.com/en-us/library/windows/desktop/aa363196(v=vs.85).aspx). After calling CreateFile() to open the serial port you will have to fill out a [DCB structure](http://msdn.microsoft.com/en-us/library/windows/desktop/aa363214(v=vs.85).aspx), then call Bu[ildCommDCB()](http://msdn.microsoft.com/en-us/library/windows/desktop/aa363143(v=vs.85).). After than you call ReadFile() and WriteFile() to read/write to the port. [Here](http://www.ewoodruff.us/CUJArticle/CUJArticle.html) is …

Member Avatar for Ancient Dragon
0
217
Member Avatar for shanki himanshu

>i understand my memmove output but why it is same as memcpy? Both functions produce the same results. The only real difference is whether the destination and source buffers overlap. If they don't, then use memcpy(), otherwise if they do then use memmove().

Member Avatar for Ancient Dragon
0
136
Member Avatar for myk45

> Visual C++ used to have support for makefiles It still does -- Visual Studio 2012 RC

Member Avatar for myk45
0
220
Member Avatar for rithish

If a[0][0] and a[0][1] are both null-terminated strings, then you have to call strcmp() to check of the two strings are the same. The following will produce a two-dimensional array of strings that contain up to 40 characters each. char a[2][2][40]; strcpy(a[0][0],"Hello"); strcpy(a[0][1],"World"); if( strcmp(a[0][0], a[0][1]) == 0) { printf("Both …

Member Avatar for zeroliken
0
591
Member Avatar for diafol

Necroposting -- I had to look that one up. Its nothing new -- people have been doing that for years. I haven't noticed any increase on DaniWeb in recent weeks.

Member Avatar for ~s.o.s~
0
195
Member Avatar for np complete

> Can some one list all the functions in windows.h You will have to buy a book to get that kind of information. [See any of these](http://www.amazon.com/s/ref=nb_sb_ss_i_1_19?url=search-alias%3Dstripbooks&field-keywords=windows+programming+c%2B%2B&sprefix=windows+programming%2Cstripbooks%2C157&rh=n%3A283155%2Ck%3Awindows+programming+c%2B%2B)

Member Avatar for np complete
0
267
Member Avatar for tux4life

>>return *(--s1) - *(--s2); That may give you the wrong result. It should be [icode]return *s1 - *s2;[/icode] There are four possible return values [list=1] [*] If *s1 is '\0' and *s2 is not, then the return value will be some negative value. [*] If *s1 is NOT '\0' but …

Member Avatar for ibykow
0
699
Member Avatar for userIT

move lines 9 and 43 down into main() then pass the file2 to print() as a parameter. Open the file only once, just before the loop that starts on line 69. Also, fstream objects must be passed to other functions by reference.

Member Avatar for userIT
0
239
Member Avatar for jmichae3

Don't post anything that is copyright by someone else without their permission. The accepted way to do that is to post a partial quote then add a link to the original article.

Member Avatar for Dani
0
654
Member Avatar for Ararat

This code compiles with vc++ 2012 RC, but its not tested. void foo(int n2, vector<int> a) { int temp, cnt; vector<int>::iterator y; for (int i = 0;i<n2;i++) { cin>>temp; cnt = 0; y = lower_bound(a.begin(),a.end(),temp); if (*y == temp) cout <<temp<<"found at"<<int(y-a.begin()+1)<<endl; else cout<<temp<<"Not found"<<endl; } }

Member Avatar for Ararat
0
1K
Member Avatar for asthaaa

> hey..m a student of last year of BCA Please STOP posting as though you were texting on your cellphone. This is a forum, not a cellphone. If you expect people to take you seriously then you need to spell out the words. There are lots of people here who …

Member Avatar for hericles
0
116
Member Avatar for james.price.39501

See the example [here](http://msdn.microsoft.com/en-us/library/system.io.file.openwrite.aspx). Delete fstream from your program because it won't work with Windows Forms, which is CLR/C++, not c++, two different languages.

Member Avatar for Ancient Dragon
0
442
Member Avatar for Ancient Dragon

I tried to make a post without code snippets of any kind in Geek's Lounge and got this error message >The code snippet in your post is formatted incorrectly. Please use the Code button in the editor toolbar when posting whitespace-sensitive text or curly braces. I found out that it's …

Member Avatar for Ancient Dragon
0
261
Member Avatar for samsons17

Best if you just ask [7zip forums](http://sourceforge.net/projects/sevenzip/forums/forum/45797) yourself

Member Avatar for JorgeM
0
1K
Member Avatar for Joe2

Does the folder have anything in it? If not then just delete it. If there are files, check to see if there is an uninstall program. Since there is not anything in control panel/programs then it is probably safe to just delete the folder. I'd rename it to something else, …

Member Avatar for Ancient Dragon
0
150
Member Avatar for napstercc

Several ways to do that, all of them require basic understanding of C and/or C++. If you are using VC++ 2010 Express or newer you can create Windows Forms which is based on the language CLR/C++, similar but different than standard c++. If you use Code::Blocks then you can use …

Member Avatar for Ancient Dragon
0
155
Member Avatar for james.price.39501

You are attempting to mix two different languages -- c++ and CLR/C++. Since you are using CLR/C++ (Windows Forms) then you must use System.io.File class instead of <iostream> and <fstream>. Forget about using standard c++ header files, they don't work with CLR/C++. Other container classses are in the compiler's include/clrext …

Member Avatar for Ancient Dragon
0
621

The End.