Hi, first off, I'm fairly new to C++ and I'm trying to teach myself how to use the language, so although to most of you my code will probably suck, please feel free to offer constructive criticism. Now that that's out of the way, let me begin my question. I'm trying to build my...
358 byte By
ikcha at 2007-11-20 10:48:19
this exported works in vb6. it probably works in c++ if <windows.h> is included. is it possible to make it work in c++ Exe without <windows.h>. BSTR __declspec(dllexport) CALLBACK StringTest(BSTR StrVal){ char Str[100]; //fill Str with StrVal, do other things char *Ret = Str; return SysA...
why does this crash? why doesn't it see the newline character?#include<iostream>using namespace std;char input[100];int i;int main(void){int i = 0;cin >> input[i];while(input[i] != '\n'){i++;cin >> input[i];cout << i << " is " << input[i] << e...
In C# this would work:Command CmdHandler;CmdHandler.AddSubCommand(new Command("testcommand","help for test command");CmdHandler.AddSubCommand(new Command("testcommand2","help for test command2");rather then declare the two new commands as variables, I just declare them directly inside the arguments....
Just wondering what all the whitespace is in c. What I know is: " ","\n","\t","\v".<br/>Is there any other?
412 byte By
uetam at 2007-11-20 10:48:48
Hi,I have a cuestion about herency and virtual functions. In following I expose my problem:Let call a class C1 with a vitual funcion f1.Let call a sub class of C1, C2.If I overwrite the function f1 in C2, the code of function f1 of C1 is not used inside f1 of C2. Is there any way to call this code?I...
291 byte By
kb8coolj at 2007-11-20 10:48:51
Hi. I was trying to implement a circularly linked list in my ADT queue class. I was wondering how to change the one pointer that points to the back of the queue to come back around to the front, rather then just pointing to Null. Do I have to declare it somewhere? Thanks for any assistance.
2294 byte By
wekel123 at 2007-11-20 10:49:06
Hello,I have a problem with compiling zpipe.c from www.zlib.net. The zpipe.c is as I found out a mini zlib, to learn how zlib is used. But I cannot compile it. There are different error message depending on the compler gcc or g++. I thought it is just an ANSI C program and I need just ANSI C. Here a...
245 byte By
muran at 2007-11-20 10:49:21
hey guys, just wondering if theres another way of writing MODS in an if/else statement style<br/>example... 7%5 ?<br/>because cout<<7%5 , we can easily get an answer of 2 on the output...<br/>what if we had no function "%" ?
I was looking at a file and I found the following syntax:<br/>#define APR_INT64_C(val) (val##LL)<br/>What does the ##LL do?
1386 byte By
gsnowman at 2007-11-20 10:49:36
The following code compiles:#include <iostream>class A{ public: A() {}};class B{ public: B(A& a) : a_(a) {} private: A a_;};template<typename T>B operator<<(B& b, T& t){ std::cout << t; return (b);}B operator<<(A& a, int c){ B b(a); return (b <<...
Hi,I am trying to return a huge heap memory from a function and it is overwriting the stack. So, when the function returns the program counter has invalid data and it crashes the program.The following is the sample code:void main(){ char *temp; temp=allocateHugeMem();}char *allocateHugeMem(){...
I want to grab a line from a file input and scan it for a specific pattern or string. Is there any function that can do this or else will I have to do it character by character?<br/>Thanks!
Sup friends,Now that I'm getting used to Win32, I have less trouble at it then before, but for some reason his code does not work, why? -#include <windows>const char *ClsName = "BasicApp";const char *WndName = "A Simple Window";LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg,...
3063 byte By
jj71787 at 2007-11-20 10:50:08
Betty's Bagelry charges $3.80 for a baker's dozen of bagels (13 bagels). The price for half a dozen (6 bagels) is $2.60. A single bagel costs $ .50. Betty is an honest merchant. Customers always get the best price on an order, even if they get more bagels than ordered. For example, a...
2995 byte By
kottyn at 2007-11-20 10:50:10
Below are (2) errors DEV- C++ is reporting:Line 45: expected constructor, destructor, or type conversion before '<' token Line 45: expected `,' or `;' before '<' token I also attach a word document highlighting the error. Could you assist me in resolving these...
1536 byte By
kottyn at 2007-11-20 10:50:12
Below are two errors, and my C++ Code that I cant resolve using DEV-C++. Ive highlighted the (2) Errors. Could you assist me in resolving these (2) Errors?Ive attach word document highlighting the error.(2) Errors:Line 12: `end1' undeclared (first use this function)Line 12: (Each undeclared...
Hi guys!For one of grad classes (PSP) I have to create a logical LOC counter (I am using C++). Part of the instructions read as follows: "...place one logical line on each physical line and count physical lines." Now, I made a logical LOC spec on what to count and not to count, however, does that...
How do I go about making a UI like vim? It's still text and works over SSH, but its more interactive, like in vi you can edit up/down etc then swap to command mode and the display changes, but it does not need to do a clear screen then redraw everything each time you do a change. How is this...
300 byte By
hsteo at 2007-11-20 10:50:16
Hi experts,<br/>I wonder if anyone know about using vector...currently I had this error popping out on a program:<br/>Debug Assertion Error!<br/>Vector iterator not dereferenceable<br/>this line of error occurs on the line 99 of vector.<br/>Anyone got any idea?<br/>Thank you...
I created a static library that itself links to other libraries that it uses. Why is it that I need to link to those other libraries from any application that I try to build using my custom library?Is there a way around this behavior? One of the main reasons I wanted to use a library is to avoid l...
1460 byte By
pankajb at 2007-11-20 10:50:29
Hi All,I am trying to get the length of an char pointer but the app is getting crashed by giving error - Access Violation. I am not getting why this is happening. The piece of code is given below - CODECode:int length = 0;char** strArr = (char**)malloc(sizeof (char * )*(4));temp=(char*)malloc(sizeof...
1947 byte By
kottyn at 2007-11-20 10:50:32
Im having problems with the program code below. When I run the code in DEV-C++, it is suppose to execute a sequential selection, repetitive statement and a function call. Unfortunately, When the command window prompt me to: Welcome to programs of my cmis 102 courseEnter your choice of Selection or...
1962 byte By
The SharK at 2007-11-20 10:50:34
Why is it, that in order to make "What is your first name?"of student 2 appear, I have to put in cin.get() ?when I already have cin.getline() ?#include <iostream>#include <conio.h>#include <string>using namespace std;struct student // Structure, used by two students !{ char Fna...
724 byte By
Master. at 2007-11-20 10:50:40
hi , well im alittle bit confused ..no im alot confused ... there lots of programming languages out there and i dont know which to study ..!!!i have a primary information about C and C++ language ... i ve heard , c is one of the most powerful languages in the world and you can do anything and write...
1350 byte By
dave2k at 2007-11-20 10:50:47
i have:class CPhoto{ bool comparePaths(CString s) { return s == m_sPathOrig; } // Other stuff}typedef boost::shared_ptr<CPhoto> CPhotoSP;typedef std::vector<CPhotoSP> CPhotoSPVc;typedef CPhotoSPVc::iterator CPhotoSPVcItr;As you can see i have typedef'd a vector an co...
200 byte By
frei at 2007-11-20 10:50:50
Hello<br/>Maybe an easy question for you... but what does the following expression really do?*alpha++='(';Can someone help me? (besides *alpha is a char pointer...)<br/>Thank you!!
I am badly in need of Code for Quine-McCluskey Reduction. Can any one upload their code or just notify the link. The language may be either C++ or Java..... Please...
2767 byte By
_aspic at 2007-11-20 10:51:06
I try to understand better how buffer overflow works using the following good document : http://arxiv.org/pdf/cs.CR/0405073 (french language)However, I can't reproduce an easy example (using environment) of buffer overflow on my system, I tryed other basical codes found on internet and still no...
279 byte By
tianqio at 2007-11-20 10:51:14
assign a temporary object to a const reference is legal, we can get the following code:(suppose A is a class with default constructor)<br/>const A& a = A();<br/>while this code A& a = A() is illegal.<br/>why?<br/>what is the consideration of compiler to forbidden this behaviour?
443 byte By
rba1988 at 2007-11-20 10:51:16
Hello. I've always wondered how they print the hex equivalent of a certain array of characters side by side..Like for example, I have an array of characters with size x:char[x];then I would like to print both its string and hex equivalent side by side with 4 elements per line. For example:H0 P6...
832 byte By
dermite at 2007-11-20 10:51:22
I have a map containing keys and values. The value element is an instance of a class called "Line". I get each value using find:Line lx = lines.find(i)->second;Then I make some changes to the class instance lx. These changes are not reflected in the map. So evidently lx is created using Line...
766 byte By
Feoggou at 2007-11-20 10:51:23
Hello.I am trying to make a template class, but if I put the class definition in the header (CMyTemplClass in "MyTemplClass.h") and its members, constructor, destructor in the .cpp, I include the "MyTemplClass.h" file in the .cpp I need, and try to create an object of this type (e.g. using type int)...
I am using a GCC c++ compiler of version 3 and I need to port my application to a new machine having "Hp ACC" compiler of version 6. Is it possible? If not what other option do I have as reverting to the older version is not an option...The architecture of the new machine to which I am porting my ap...
Well,because the professor who took my C programming classes in my Engineering Course used to explain things quite well, I therefore know the exact process that the arguments in a function call go through to get inside (or be passed to) a function body.But somehow no-one ever explained to me what ha...
I'm trying to break up my main.c in to smaller chunks to make it more manageable. But I'm having problems getting it to work. For example, variables defined in main.c are not recognised in .c files included further down. Also, SDL functions are not recognised by included files even though...
I want to find out how i can learn how to program a program that blocks certain ports from being used, and runs as a background process. specifically blocks remote entry to the computer its running on, if its from the ports specified.i have been searching and can't find any tutorial or example...
Hi, I was wondering if someone could tell me why this code won't compile: int num = 5; int* const bar = # std::vector<int* const> foo; foo.push_back(bar);I'm sure there is a simple reason...I'm just not getting it. -Thanks...
833 byte By
TR86 at 2007-11-20 10:51:51
hi everyone, this should be a simple question for you guys that know c++ pretty well. i just got all the errors out of this program but it still is not working. what it is supposed to do is read 2 numbers from the input.dat (saved in the directory of the cpp file) and then print the sum of them in t...
I'm working on a program for my C++ class, and I may have gotten myself in over my head.I've been working ahead and doing things like using input buffers so users providing strings where ints should be doesn't break the program...Anyway, I've got an interesting problem...Every ti...
1584 byte By
THY02K at 2007-11-20 10:51:59
Hi... this is a bit philosophical ... I noticed a class attributed getting corrupted *on return* of a function... BUT when I step INTO the function, no memory corruption even when debugger pointing at *last* line (return statement) of the function. It wasn't until [the moment] debugger stepped...
7975 byte By
hsteo at 2007-11-20 10:52:26
Hi gurus, for those who have Visual studio 2005, do you mind if you could try and compile to see if there is a similar error occuring for this line of code?#include <iostream>#include <fstream>#include <cstdlib>#include <vector>#include <map>#include <set>#include...
1409 byte By
Joulyn at 2007-11-20 10:52:28
Compiler: Default compilerBuilding Makefile: "C:\Documents and Settings\Andreas Saarva\Mina dokument\test\Makefile.win"Executing make cleanrm -f ../../Skrivbord/samples/Sol++2000/ProgressBar/ProgressBar.o Project1_private.res hoahao.exeg++.exe -c ../../Skrivbord/samples/Sol++2000/ProgressBar/Progre...
Solved
76 byte By
Geof at 2007-11-20 10:52:32
Hi, <br/>I'm looking for file dnsapi.lib. Where can get this file?
324 byte By
Rooting at 2007-11-20 10:52:39
hi friendsi'd start whith c++ for openbsd..is the same, but whith c++ i compilemain.cpp such this.:#include <iostream.h>int main(){ return 0; }becouse gcc doesn't compile it??..have anyone a guide where i study it??thanks!...
702 byte By
Penfold at 2007-11-20 10:52:52
Hi,I am using the CreateFile() function in order to create a handle for a RS422 serial port, through which I am sending and receiving data. I need to know how many bytes of data are sitting on the port at any given time (either data received on the port that my software hasn't processed yet, o...
HeyI am very new, but I hit a problem that really stumped me and I can find little documentation on line.I am having a bit of an issue. Something I have written compiles, but does not work how I expected it to. In short, I have a function made in file A to get the time. I call said function in file...
87 byte By
ikcha at 2007-11-20 10:53:35
what are different ways to pass array to this function?.<br/>void passarray(int *p[10])
1362 byte By
errtime at 2007-11-20 10:53:44
hello, my programm must allow user to enter only integer values, if user enters char or string programm gives him a warning and asks to enter value again..its nothing hard but i am missing here something..ill write u what i have tried so ull better understand the problem and i hope u guys can help m...