49,761 Topics
| |
Hi, How do I check if a member of a struct is null? I've tried: [CODE]if(ErrorInfo->TestName != NULL)[/CODE] The above method returns true even when [B]ErrorInfo->TestName[/B] contains nothing (debug shows it as 0xccccccc, ""). [CODE](!(strcspn(ErrorInfo->TestName, "") == 0))[/CODE] The above method throws an access violation. I've tried other ways too … | |
Okay, I’ve got a noob question. It’s been awhile since I coded so I thought I’d start off at the beginning and create a template list and tree. Back in the old days I left the nodes open, but I wanted to keep the data private this time. My first … | |
Hello, I am a newbie in C++ programming. I try to write a C++ program to first read and split a hugh text file (that containing multiple small files inside it) into multiple small text files, then I need to write the first line of each small text file into … | |
[CODE=cpp]void BOARD_Unselect_All(System::Windows::Forms::Form^ Frm) { Frm.a1->BackgroundImage = Image::FromFile("elephant_pla.gif"); }[/CODE] a1 is a picturebox from the form. How do you use the buttons, picturebox, etc from the form being passed in? | |
Hi, I am new to ACE. I want to use ACE library. I have seen so many codes. But if there is any document which explains elaborately about the macros then it will be useful. Like how to use ACE_DEBUG, ACE_ERROR. READ_MASK etc Please help | |
[CODE]// #include <iostream> using namespace std; #include <cmath> #include <math.h> int main() { float a, b, c, t, s, area; cout << "Enter the lengths of your triangle's sides: "; cin >> a >> b >> c; if(a>b) {t=a; a=b; b=t;}; if(b>c) {t=b; b=c; c=t;}; if(a>b) {t=a; a=b; b=t;}; if((c*c) … | |
Hi This is Singleton class program, please let me know any changes required in this code............... #include <iostream> using namespace std; class Singleton { private: static bool instanceFlag; static Singleton *single; Singleton() { //private constructor } public: static Singleton* getInstance(); void method(); ~Singleton() { instanceFlag = false; } }; bool … | |
hello, i am a beginner to visual studio. i want to know how can i use pthread in visual studio 2008. am i supposed to download the dll? if yes, then after downloading how can i use that dll in my project. please help. Karishma. | |
I need help...This is the class i am supposed to use... [CODE]#ifndef_MINESWEEPER_H #define_MINESWEEPER_H #include <iostream> #include <ctime> #include <cstdlib> using namespace std; const int SIZE = 3; class minesweeper { public: minesweeper(); minesweeper(int mines); void resetGame(); int flagCell(int x, int y); void unflagCell(int x, int y); int uncoverCell(int x, int … | |
Hi everybody I defined an array pointer to hold a massive amount of data, (actually the RGB data of a screen with 1024*768 pixels). the data is assigned from another temporary array to the this array within a function that calculates the values of the temporary array and then assign … | |
I have a problem with my console program. I have a text file named "myRecord.txt" with the following contents: 101,Carlito Caballero,500.00 102,Tina Gamboa,560.34 103,Angel Caballero,750.55 104,Kyla Shane,850.32 105,Jogie Glen Mait,1000.00 If I run the program, the console should prompt the user to enter the id number (which is the set … | |
[I]<<edit: [URL="http://www.daniweb.com/forums/post191005.html#post191005"]split from here[/URL]>>[/I] Hi. My i ask something?,,can you help me please to solve this Problem? How Can i call Full Record using strtok and strcmp in text file Please!!!! [CODE]101, Carlito Caballero, 500.00 102, tina gamboa, 560.34 103, angel caballero,750.55 104, kyla shane, 850.32[/CODE] Here's the code [CODE]#include … | |
I'm working on a prototype program for my class assignment. I didn't wanna jump into it quite yet until I understood how functions worked so I decided to make this. It's going pretty well and now what I'm trying to do is make it so the program takes user input … | |
I am mostly familiar with C++. :?: Please help. Question is below : Write a program to discover how many numbers between 1 and 40 can be expressed as the sum of 4 positive squares (e.g. 15 = 12 + 12 + 22 + 32). | |
hello everybody hi im a student of SGRRITS (my institute) in my inst we have turbo c++. is it a good platform for doing programming now a days and does any industry us it now a days. no.2: please can you suggest me its substitute which are better than it. … | |
Hello. I am debugging a larger project and a tool called Crash Validator keeps pointing line 1 in my code extract:"inline bool SortKnownFiles2 (etc.)" in DirLoader.cpp Error message in Crash Validator is “Cannot create a file when that file already exists.” (in c++ it runs fine, except a few random … | |
Is it possible to password protect a dll at compiletime. Please excuse my noobness, but let me explain what I mean. You app an runtine makes a lot of calls to a function in a library so it opens it and keeps it open for the duration your app is … | |
Hello I'm looking to extract jpeg image data from a mjpeg stream, but I'm not sure how to do this in c++ . The code snippet below does the job of connecting to the remote ip camera server & receives the mjpeg stream via tempBuffer variable. [CODE] // Loop and … | |
can I use fopen,and fwrite with ShellExecute? to take file in buffer,drop it in directory and run it with ShellExecute I did this way but I just get cmd window and file is corupted do I have to use some API to take file in buffer? | |
I just started my mid level c++ class. In the past we have been using Visual Studio, which I can access thru a VM that our school supplies, so I can program from my Mac no problem. In this class, however, we are switching to a linux based programming tool, … | |
[CODE]#include <iostream> #include <conio.h> using namespace std; main() { int a,b; b=50; cout<<"enter a value less than 50: "; cin>>a; do { cout<<"A number: "<<a<<endl; a++; Sleep(100); } while (a<=b); getch(); return 0; } [/CODE] | |
I did'nt understand here in this code i was reading a book and then const char *q="Hello"; //string is fixed pointer is not *q='M'// error q="bye"; //works char * const t="Hello"; //string is fixed pointer is not *t='M'// works t="bye"; //error so my question is in first if string is … | |
Hello guys. How can i get my file path? I konw my program's name but i don't know where it will be put. How can i get file path during program's execution? Thank you | |
Hey guys, I have a question. I'm writing a script in c++ and want to have the script copy a file whose name was previously determined by the script to a output file who's name is determined through functions and procedures within the script. The whole script is looped until … | |
Here is simple c++ program to demonstrate matrix rain. Compiler:TurboC | |
Something that puzzles me in the following simple program: [CODE] #include <iostream> using namespace std; int main() { int row; cout << "enter row: "; cin >> row; int K[row], m[row][5]; cout << "Enter all the " << row << " K values:\n"; for (int i=0;i<row;i++) cin >> K[i]; cin.ignore(10,'\n'); … | |
i am curious about the unordered map of boost this is the first code I wrote [code = first] typedef pair<int, int> axis; typedef boost::unordered_map<axis, int> mCost; void testUnorderedMap() { mCost mc; axis p(0, 0); mc.insert(mCost::value_type(p, 3)); p.first = 0; p.second = 6; mc.insert(mCost::value_type(p, 33)); p.first = 0; p.second = … | |
I need to store about 0.1million int into the unordered_map and need the key(int, int) to search them The size of the data are fixed, and I don't need to change the data so oftenly Search is much more often than insert(more than 20 times of insert) I try to … | |
I'm writing a program that asks the user how many numbers they would like to input, then proceeds to ask the user to enter the said amount of numbers. At the end, the program computes the sum, average, largest number and smallest number. I've got the entire program figured out, … | |
Hello all, Im working on my assignment that deals w/ the use of classes but I'm a bit stuck at the moment. The assignment overview is fairly simple: I just need to read in a .dat file which contains some elevation data into a 2d array and then use that … |
The End.