49,766 Topics

Member Avatar for
Member Avatar for MasterGberry

I am having issues with the compiler in checking to see if a piece of a string is empty or not. I have a feeling this is simple, but today has not been my day with this code, but I am still doing my best. Ty tableRow is a std::vector<std::string> …

Member Avatar for elsiekins
0
161
Member Avatar for ITHope

I am currently taking C++ but i am also in Software engineering. for my software engineering class we have to create a project(of our own choosing) coding included by April. my question is how would i use c++ to create a rigorous/simple software.... i want to do something pertaining to …

Member Avatar for daviddoria
0
178
Member Avatar for indr

i gave the copy constructor in the below code just to know when will it be called.. [CODE] #include<iostream> using namespace std; class counter { int val; public: ~counter() { cout<<"destructor"<<endl; } counter(counter&) { cout<<"copy constructor called"<<endl; } counter():val(0) {} counter& operator++() { ++val; *this; } int getval() { return …

Member Avatar for Fbody
0
218
Member Avatar for Crutoy

Hello , i was doing an exercise in book which asked to draw a diamond shape by displaying '*' using nested for loops. It took me quite a while to come up with a way to reverse the pyramid , and complete this exercise. So i was hoping some one …

Member Avatar for Crutoy
0
105
Member Avatar for megaLU

Hi, I'm very new to C++ and am trying to write a class to model affine transformations. I have written code for a 3x3 matrix and am now trying to write code for multiplying it by (x,y,z) where z=1. My problem is I can't return the two values for the …

Member Avatar for megaLU
0
154
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
194
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
180
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
73
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
101
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
150
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
148
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
111
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
212
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
98
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
210
Member Avatar for simply_viks

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

Member Avatar for hvalola
0
88
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
207
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
96
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
232
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
191
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
120
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
251
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
153
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
135
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
103

The End.