138 Posted Topics

Member Avatar for vmirz

First off, in C, there is no built-in string data type. Therefore, string is represented in an array of characters. The null terminator depicted by a \0 (backslash zero). It is the way of telling where the string ends. Recursion means a function keeps calling itself until the termination case …

Member Avatar for chiwawa10
0
105
Member Avatar for Lukezzz

Usually, one would get the list of applications running and check if a particular application is in the list. In your case, you may want to check whether "firefox.exe" is running (or any other browsers). Once detected, kill the process and the browser will close. [B]NOTE:[/B] It may be too …

Member Avatar for Lukezzz
0
110
Member Avatar for jeffrey o

In your MAIN CPP FILE, you only need to include the declaration header file (.h) for your vehicle. That is sufficient for you to use the 'vehicle' class. You do not have to include the implemenation file (.cpp) in your main file. The compiler is smart enough to find the …

Member Avatar for Fbody
0
145
Member Avatar for spetsnaz26

Do note that your filename variable is in the loop; which will make the name keep on expanding. E.g. data1, data12, data123, ... You have to reset it to "data" after the output stream is closed. Also, you need to append the file extension name (in your case, the .txt)

Member Avatar for spetsnaz26
0
255
Member Avatar for naveed1

Use the built-in function sizeof() to get the size of your class in bytes. [CODE]// prints out the size of 'myClass' in number of bytes cout << sizeof(myClass)[/CODE]

Member Avatar for jwenting
0
64
Member Avatar for xikkub

You can remove the destructor; ~Node(); since you are not implementating it. In this case, the compiler actually generates the default destructor for you. However, if you want to customize your destructor, do add in your implementation as in: [CODE]~Node() { // your code goes here }[/CODE]

Member Avatar for chiwawa10
0
2K
Member Avatar for sunlitdays

Use the cin.getline() function instead of cin. Your code should look like this. [CODE]cin.getline(str, max)[/CODE]

Member Avatar for chiwawa10
0
240
Member Avatar for kalamku99

It seems like you are learning the basics of C++. Do go through these sites for a good walk through tutorial. [URL="http://www.cprogramming.com/tutorial.html"]http://www.cprogramming.com/tutorial.html[/URL] [URL="http://www.learncpp.com/"]http://www.learncpp.com/[/URL] Happy Learning C++

Member Avatar for chiwawa10
0
92
Member Avatar for bandit711
Re: help

It seems like you want to format your output in a more presentable manner; by spacing. This link may be useful. [URL="http://www.informit.com/articles/article.aspx?p=170770"]http://www.informit.com/articles/article.aspx?p=170770[/URL]

Member Avatar for chiwawa10
0
104
Member Avatar for sjn21682

I agree with adatapost suggestion. Always try to pass the value of the textbox from form.cs to your new class. Do not try to access the value directly (even though you can do that). It will eventually breaks the concept of encapsulation. Try to pass your variables through method call …

Member Avatar for jonsca
0
212
Member Avatar for rkp728

For myself, defining a pointer means careful handling of memory to prevent leakage. Memory allocation and memory releasing have to be handled manually in C++, unlike managed code. When you have a pointer, remember to free up the meory when they are no longer needed. However, do keep in mind …

Member Avatar for jonsca
0
100
Member Avatar for vellayil

It depends on the IDE you are using. In MS Visual Studio, add your DLL to in the project settings. Add it to the linking library in order to use the DLL. Do correct me if I'm wrong.

Member Avatar for vellayil
0
65
Member Avatar for timhuynh

It is never wrong to start learning C when you want to pick up C++ skills. After all, C++ is the superset of C. Through this, you will be able to differentiate between both of them. For 'true' and 'false' are not defined in C language, you may want to …

Member Avatar for chiwawa10
0
160
Member Avatar for chiwawa10

Dear members, I am looking for .NET functions to change power settings of a PC. For example, the hard disk turn off time, screen brightness, monitor turn off time. All these are intended to save energy. After some studies, I found that [B]DeviceIOControl[/B] provides such capabilties. However, I am not …

Member Avatar for chiwawa10
0
381
Member Avatar for Afupi

If you want to keep track of the visited coordinates, you will need to keep a 2D array of a map for flagging. Mark each position once you have visited that spot. Please bear in mind that you may still need to revisit a coordinate in order to find the …

Member Avatar for Afupi
0
227
Member Avatar for goody11
Member Avatar for aliaks

Here is a simple idea. 1. Arrange your strings in the text file so that the program can easy parse the strings into questions and options (e.g. separate them by line) 2. Define struct to store your set of questions and options (e.g. there are some examples already posted) 3. …

Member Avatar for VernonDozier
0
166
Member Avatar for lotrsimp12345

If you do not explicitly define a constructor for your class, the program will call the default constructor. This is not recommended as your variables will contain random value. Constructor and destructor are highly recommended to carefully handle memory (constructor - to initialize values of variable before they are used) …

Member Avatar for packrisamy
0
263
Member Avatar for sdmahapatra

hey FirstPerson, where did you found the algorithm? Is it proven and works on any other number? Regards, Nick

Member Avatar for mrnutty
0
125
Member Avatar for Nathan Campos

Agree with MosaicFuneral, it is recommended to use ShellExecute() if you're in Windows.

Member Avatar for chiwawa10
0
105
Member Avatar for gretty

When working with std::string only, I recommend to use the equal sign to copy one string to another. Usually I would use strcpy only when I'm caught in a situation dealing with char array and std::string. Is this the right way of using strcpy? Can anyone give some good advice? …

Member Avatar for mrnutty
0
218
Member Avatar for invisi

Hi invisi, The problem is obvious. Do remember this rule. Use delete when you have use a "new". In your case, you did not "new" a variable. You are merely assigning the pointer to another variable. As a matter of fact, this cannot be deleted. If you are using the …

Member Avatar for mrnutty
0
906
Member Avatar for chiwawa10

Hi all, I am having trouble trying to load contents on a tab in accordion on the fly. Which means, the content for a particular tab will only be loaded and displayed when user click on it. Is there any example available? I am still trying it with Ajax. I …

Member Avatar for ayesha789
0
80
Member Avatar for chiwawa10

Hi all, I have a piece of program written in Visual C++ which works just fine in Win XP. However when its run in Vista, the error message "A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available." …

Member Avatar for Salem
0
118
Member Avatar for ITJohn89

another alternative which I personally feels is better than Dev-C++ is CodeBlocks. Dev-C++ IDE has not been updated for too long.

Member Avatar for mitrmkar
0
117
Member Avatar for Black Magic

You can use dynamic memory allocation. Learn that stuff because its good for you. There are two types of dynamic memory allocation. 1. malloc 2. new *pls correct me if I'm wrong

Member Avatar for chiwawa10
0
113
Member Avatar for Kaushalya

For your information, the escape character in C++ is the backslash. Hence, if you want a backslash, you need to add another backslash in front of it. (E.g. \\ will give you a backslash)

Member Avatar for chiwawa10
0
89
Member Avatar for mussa187

yeah, I think the only way to check is the value. Since an unsigned 8 bits integer (or unsigned char) can only store (0 to 255). The best way is to check whether the value is between the range. [COLOR="Red"]*make sure the memory for storing input is sufficient. After which …

Member Avatar for chiwawa10
0
83
Member Avatar for Luckychap

Here's a simple example of OOP in real life (building of a car). Before that, I would like to stress that this example is not complete and only explained at the overview level. Here goes: A car has windows. So, you might want to declare a glass class which is …

Member Avatar for chiwawa10
0
123
Member Avatar for cedtech23

why not use the C++ STL string? E.g. [code=cpp] #include <iostream> using namespace std; int main() { string fname[100]; for(int i=0; i<100; ++i) { cout << "Enter name: "; cin >> name; } //cout << endl << "You entered: " << name << endl; //system("pause"); return 0; } [/code]

Member Avatar for Ancient Dragon
0
173
Member Avatar for Traicey

array is easy. you declare them statically like, int a[10] for an array to store ten integers. Accessing them are simple: a[0] = the first item a[1] = second item a[9] = the last item [COLOR="Red"]*be careful of the array bounds as you might access item that is out of …

Member Avatar for Traicey
0
103
Member Avatar for arlene1

if you're gonna pass the address of the variables as stated in line 23: void yrCalc(int totalDays, int& year, int& month, int& day) Your variables should contain also their address in line 16: yrCalc(40000, [COLOR="red"]&year[/COLOR], [COLOR="red"]&month[/COLOR], [COLOR="red"]&day[/COLOR]);

Member Avatar for Ancient Dragon
0
108
Member Avatar for chiwawa10

greetings, I would like to build a subset from a Hashtable. The subset is a Hashtable too. How could I do it? Is there any API out there? Any advise or guideline are appreciated, thank you! :rolleyes:

Member Avatar for jwenting
0
446
Member Avatar for chiwawa10

I have been trying to find out what is the meaning of m_nRetCode (value=1012). I get this exception when my program try to execute insert entry into database. Can anyone pls tell me what is the meaning of the value 1012 which is the value of m_nRetCode? Where can i …

0
77
Member Avatar for chiwawa10

Hi all, I'm facing this problem in my running app. It is a real-time app and writes to the database whenever data is received. However, there is rare occasions that causes the ExecuteSQL to fail. However, the failure did not throw any exception, so my CDBException did not detect anything(it …

Member Avatar for chiwawa10
0
277
Member Avatar for cluna

for more info, pls browse: [url]www.cplusplus.com[/url] or msdn.microsoft.com (if you're using VC++)

Member Avatar for chiwawa10
0
188
Member Avatar for bandm

include the header file --> #include <stdlib.h> then add this --> system("pause"); before the return 0; *It causes the program to stop until it detects any keypress...

Member Avatar for bandm
0
199
Member Avatar for chiwawa10

Hello, I'm facing a with a real-time app. This real-time app is reading data from the serial port, then, process it. However, it seems to miss some data when the computer has some other apps running. More data are lost when other app do heavier processing. When i try to …

0
103

The End.