49,761 Topics

Member Avatar for
Member Avatar for SacredFootball

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

Member Avatar for Moschops
0
193
Member Avatar for SamPrat

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 …

Member Avatar for SamPrat
0
175
Member Avatar for pseudorandom21

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

Member Avatar for pseudorandom21
0
71
Member Avatar for exca

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

Member Avatar for exca
0
100
Member Avatar for skorm909

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

Member Avatar for mrnutty
0
149
Member Avatar for BowMadness

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.

Member Avatar for mrnutty
0
25
Member Avatar for dalymiddleboro

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

Member Avatar for Fbody
0
147
Member Avatar for Mr_PoP

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

Member Avatar for Mr_PoP
0
110
Member Avatar for Nirliq

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 …

Member Avatar for Nirliq
0
133
Member Avatar for teoh

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

Member Avatar for JSPMA1988
-3
210
Member Avatar for Duki

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]

Member Avatar for Ancient Dragon
0
2K
Member Avatar for arthurav

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 **); …

Member Avatar for vijayan121
0
2K
Member Avatar for Mr.BunyRabit

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 …

Member Avatar for Mr.BunyRabit
0
97
Member Avatar for privs

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 …

Member Avatar for jonsca
0
205
Member Avatar for simply_viks

please send me n example for string concatination using ACE ACE_CString.. thanks.

Member Avatar for hvalola
0
86
Member Avatar for deanus

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

Member Avatar for Banfa
0
204
Member Avatar for rcmango

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

Member Avatar for rcmango
0
95
Member Avatar for iwanttolearnc

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 …

Member Avatar for iwanttolearnc
0
231
Member Avatar for SpecialForce

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

Member Avatar for mike_2000_17
0
1K
Member Avatar for dennis.d.elston

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 …

Member Avatar for dennis.d.elston
0
190
Member Avatar for eline83

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 …

Member Avatar for eline83
0
119
Member Avatar for triumphost

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

Member Avatar for triumphost
0
249
Member Avatar for Frederick2

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?

Member Avatar for Frederick2
0
150
Member Avatar for Infame

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)*/ } …

Member Avatar for thelamb
0
133
Member Avatar for AhmedGhazey

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

Member Avatar for AhmedGhazey
0
100
Member Avatar for taurus3

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

Member Avatar for MosaicFuneral
0
471
Member Avatar for Kimmi

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? ;)

Member Avatar for Moschops
0
199
Member Avatar for imolorhe

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 …

Member Avatar for mike_2000_17
0
194
Member Avatar for Frederick2

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 …

Member Avatar for Frederick2
0
552
Member Avatar for docmccoy

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 …

Member Avatar for arkoenig
0
111

The End.