49,761 Topics
| |
Hello everyone. I'm just about finished with my degree and am now taking a Data Structures class. So far, it doesn't make sense to me. I'm seeing code snippets of 100+ lines that I could solve in 10. Hopefully I begin the realize the power of Data Structures soon. Anyways, … | |
Hi Folks, I have written a read function which reads values from serial port(LINUX) . It returns values as pointer to char . I am calling this function in another function and storing it again in a variable as pointer to char . I occasionally got stack over flow problem … | |
For some reason, and it's probably one of those accessibility things like tab ordering, when I hit the spacebar after selecting a button on my form, the spacebar clicks the button. This is NOT acceptable, and I have considered a work around of selecting an invisible panel or other "dummy" … | |
Hi all, I am trying to write a program that computes the areas of intersecting rectangles. The coordinates of the rectangles are given. A rectangle may intersect another one or just stand alone. My code is: [CODE]Rectangle class: #include "Rectangle.h" Rectangle::Rectangle(){ this->parent=this; this->area=0; this->x1=0; this->x2=0; this->y1=0; this->y2=0; this->visited=false; }[/CODE] [CODE]/* … | |
first off i have a game in the making, its pretty simple but im just getting the feel of making the game before i get into depth with it. I'm wondering how i can run my game without needing to open up visual c++ 2010 and running it from there... … | |
I am trying to design a program that can give 2 random numbers then use a random operator to solve. I am having problems trying to figure out how to take the 2 random numbers and add/subtract/multiply/divide. If anyone could help it would be greatly appreciated. | |
I'm getting the following error when trying to write to a file: 1>Linking... 1>mit_lesson1.obj : error LNK2019: unresolved external symbol "int __cdecl do_stuff(int,int,int,int)" (?do_stuff@@YAHHHHH@Z) referenced in function _main 1>C:\Users\Michael\Documents\Visual Studio 2008\Projects\MIT\Debug\MIT.exe : fatal error LNK1120: 1 unresolved externals 1>Build log was saved at "file://c:\Users\Michael\Documents\Visual Studio 2008\Projects\MIT\MIT\Debug\BuildLog.htm" 1>MIT - 2 error(s), … | |
[CODE] #include "SQL.h" const char * pQuery(const char * query,...) { va_list argptr; va_start( argptr, query); char buf[4096] = ""; sprintf(buf,""); int ret = vsprintf(buf + strlen(buf), query, argptr); strcpy(buf + strlen(buf), ""); va_end( argptr ); return buf; } [/CODE] [CODE] MYSQL * mysql; int main() { //loading the config … | |
I hava a prooject that uses ShellExecuteInfo and it works fine as log as you don't want to change the name of the file. [CODE] SHELLEXECUTEINFO fei; fei.cbSize=sizeof(SHELLEXECUTEINFO); fei.fMask=SEE_MASK_NOCLOSEPROCESS; fei.hwnd=GetDesktopWindow(); fei.lpVerb="Open"; fei.lpFile="C:\\Program Files\\WinZip\\wzzip.exe"; fei.lpParameters="-a+ -r -P -whs -x@nobackup.txt C:\\Progra~1\\DIR\\DIR\\Data\\ful.zip @backup.txt"; fei.lpDirectory="C:\\Program Files\\Patches\\GLB\0"; fei.nShow=SW_HIDE; fei.hProcess; [/CODE] I would like to be … | |
[CODE]class StudentMark { public: StudentMark(); StudentMark(double); double getGrade(); }; #include"grade.h" #include<iostream> using namespace std; StudentMark::StudentMark() { double mark=0.0; } /*StudentMark::StudentMark(double dNewmark) { dmark=dNewmark; }*/ StudentMark::StudentMark { if(mark>=80&&mark=<100) grade='A'; else if(mark>=75&&mark<80) grade='A-'; else if(mark>=70&&mark<75) grade='B+'; else if(mark>=65&&mark<70) grade='B'; else if(mark>=60&&mark<65) grade='B-'; else if(mark>=55&&mark<60) grade='C+'; else if(mark>=45&&mark<55) grade='C-'; else if(mark>=40&&mark<45) grade='D'; else … | |
Does anyone know what this is? It's in a piece of code I'm trying to debug, and I've never seen it: [code=c++] typedef void FAR * socktag; [/code] Also, could someone explain the difference between these two lines (after the typedef executes): [code=c++] socktag SMTPSock; int SMTPSock; [/code] | |
I am creating a template class for working with matrices and get an error when I try to use the overloaded << operator. This is the code: [CODE]#include<iostream> #include<string> #include<conio.h> using namespace std; template <class T> class matrice { T **a; int m,n; public: matrice(); matrice(int,int); matrice(FILE *); matrice(int,int,T **); … | |
Hey there I have a part in my program where it should calculate the total in one column of my datagridview. All goes well and good while there are no Null values between them in my column. So i thought ill use exception handling seeing that my If statement throws … | |
Hi I am new to C++ and am using borland studio 2006 C++. I recently have been forced to take over the support for the C++ and have been given a number of complax C++ programs and these programs read and write to the registry. Now the problem comes in … | |
please send me n example for string concatination using ACE ACE_CString.. thanks. | |
Hi all, Is it possible to define a preprocessor constant using another constant and a string in the declaration, like this: [CODE] #define MAIN_PATH = "C:\\My Documents\\" #define SUB_DIR = MAIN_PATH + "MyFolder\\" [/CODE] I'm using VC++ 2010 Express... Thanks, Dean | |
Okay, so i was trying to make this work. Two queues need to be created using input from the user for 2 file names. For some reason I get 1 queue, the first one filled. Then the second queue never has anything in it. Please help me with better code, … | |
im trying my hand at calling c functions from python. im reading up the tutorial [URL="http://csl.sublevel3.org/C-functions-from-Python/"]http://csl.sublevel3.org/C-functions-from-Python/[/URL]. however part of the tutorial says that i should [QUOTE]Compiling dynamic libraries on Mac OS X is different from the usual gcc -shared you might be used to: gcc -dynamiclib -I/usr/include/python2.3/ -lpython2.3 -o myModule.dylib … | |
Hello, I am trying to ofstream a file using the following code: [CODE]#include <curl.h> #include <stdio.h> #include <fstream.h> struct callback_data { FILE *output; }; static long file_is_comming(struct curl_fileinfo *finfo, struct callback_data *data, int remains); static long file_is_downloaded(struct callback_data *data); static size_t write_it(char *buff, size_t size, size_t nmemb, struct callback_data *data); … | |
I am trying to modify a tax program so that I only have one line that start with the variable "tax = ...". The original statements are commented out so that you may see what the original program looked like. What I don't know how to do is to put … | |
Hello guys, I'm struggling at my assignmnet. I need your help. for(int i=1; i<N; i++) for(int j=1; j<N; j++) for(int k=1; k <= i*j*log(j); k*=2) x=i+j+k; Calculate runtimes using these inputs N = 10, 20, 40, 100, 200, 400, 1000, 2000, 4000, 10000, based on the results, conjecture the complexity … | |
Using Windows Form Application from Visual Studio 2010. KK The big problem... When I compile it and run the program, Enter a value into the textbox, it automatically changes to a value the program has defaulted. I'll attach the Program/Project Folder incase anyone wants to compile/run it.. Example: Two textboxes.. … | |
What is the difference between size_t and size_type? size_type seems to be related closely with the C++ Standard String Class. Couldn't they have just used size_t instead? I don't understand the difference. Could anyone elaborate please? | |
Hi! I have a problem with a winsock code. I want it to connect to a irc server, but it won't recieve any readable data... Just alot of "jibberish"... [CODE] #include <string> #include <iostream> #include <WinSock2.h> #pragma comment(lib, "ws2_32.lib") using namespace std; //class lam0rZ { ~lam0rZ() { system("pause"); /*sleep(5000)*/ } … | |
why return type is not a part of function signature i.e. I can't make such this code [CODE] int x (int y){ return 0; } float x(int y){ return 0.0; } [/CODE] while i can make such this code: [CODE] int x (int y){ return 0; } int x(String y){ … | |
The combinations function C(n, k) is usually defined in terms of factorials, as follows: C(n, k) = n!/(k!*(n-k)!) The values of C(n, k) also leads to the Pascal Triangle: C(0, 0) C(1, 0) C(1, 1) C(2, 0) C(2, 1) C(2, 2) C(3, 0) C(3, 1) C(3, 2) C(3, 3) C(4, … | |
If RGB(170,255,213) gives a pastel green color display then what is the color code I should use if I want a deeper green color tone display? Is there a list of the color display codes for C++? or where I can lookup for sample color displays? ;) | |
I am writing a program where one part of the program gets some data while the other part gives in new data at intervals for the first part to work on. This two tasks are to be done independent of each other and concurrently. The time one part stops does … | |
Here is the full code relating to my performance problem I’m having with my operator+= which I described in this adjacent thread…. [url]http://www.daniweb.com/forums/thread340734.html[/url] As a quick review, I’m finding that the operator+= function in the Standard C++ Library’s String Class, i.e., <string>, is performing almost impossibly fast compared to the … | |
Hi all, I'm facing strange error. I defined a class: [CODE] class MyClass : public MyAbstractClass { public: MyClass() : myList(myList) {} ~MyClass() {} void AddList(list<MyObject>& myNewList) { myList = myNewList; } private: list<MyObject>& myList; }; [/CODE] And in the main I do: [CODE] // myObject is initialized here and … |
The End.