49,761 Topics
| |
I am writing an implementation of a DES encryption with a 64 bit plaintext, taken from the pixel information in a BMP file. So I want to skip the header which is 54 bytes, but I am not sure how to do this. This will not be a dynamic project, … | |
hi all its me again, i just added a replace function but its throwing error C2661: 'std::basic_string<_Elem,_Traits,_Ax>::replace' : no overloaded function takes 2 arguments. any idea? [CODE] #include <iostream> #include <string> using namespace std; string padBlanks(string, int); void removeLetter(string&, char); int main() { string string1; int padN; string inStr; char … | |
Why is this array not printing in 2D? [ICODE]#include <iostream> #include <iomanip> using namespace std; const int COLS = 5; const int ROWS = 5; void showArray(int [][COLS], int); void arrayDef(int [][COLS], int); void totalCol(int [][COLS], int); void totalRow(int [][COLS], int); void totalDiag(int [][COLS], int); void inputAmt(int [][COLS], int, int, … | |
I'm new and I don't want to waste anyone's time, but I searched and found nothing on this. I am to write a simple CRC-16 routine. My compiler (microsoft) will not accept a char[] as an operand when I try to execute the xor. char msg[5] = {'A','B','C'}; int generator … | |
i need to create a palindrome program. in our computer lab, this program works but here at home, it doesn't. help.. [CODE=c++] #include<iostream.h> #include<conio.h> #include<string.h> #include<stdio.h> int main() { clrscr(); char word[20],rev[20],chr; cout<<"This porgram checks if the word is a PALINDROME word.\n"; do { cout<<"\nEnter word: "; cin>>word; for(int i=0,j=strlen(word)-1;i<=j,j>=0;i++,j--) … | |
I've never programed in C++, and I have just started to learn C++, but I already get a little bit to complicated homeassignement. Is there anyone willing to help me - let's say solve me this excercise. I would appreciate any help with this and if there is anyone willing … | |
Hi, im reding a book where the way it draw poligons are like that: [CODE] glBegin (GL_TRIANGLES); glVertex3f (0.0f, 0.0f, 0.0f); glVertex3f (0.0f, 1.0f, 0.0f); glVertex3f (1.0f, 1.0f, 0.0f); glEnd(); glBegin (GL_QUADS); glVertex3f (0.05f, -0.05f, 0.0f); glVertex3f (0.95f, -0.05f, 0.0f); glVertex3f (0.95f, -0.95f, 0.0f); glVertex3f (0.05f, -0.95f, 0.0f); glEnd(); [/CODE] … | |
I'm working on this program for my C++ class. It works fine but I'm not quite happy with it. Basicly this accepts a string, pulls each character out and converts it to the COA equivalent. It reads the entire string including spaces, but I can't seem to get it to … | |
Hi guys. I was wondering if you could help me with this problem. I am trying to pass a dynamic array to a function for finding the length [code] int length(char ** t, int i) { int count = -1; do count++; while (t[i][count] != '\0'); return count; }[/code] The … | |
'lo there folks, MinGW's giving me 1 error I can't get rid of: [code] eventhandler.h|9|error: `element' has not been declared| eventhandler.h|9|error: ISO C++ forbids declaration of `elem' with no type| [/code] All code mentioned and I think needed: eventhandler.h [code=cpp] #ifndef EVENTHANDLERH #define EVENTHANDLERH #include "element.h" enum events {onClick, onHover}; … | |
so say I have something like this: [code=cpp] #include<iostream> class A{ public: void setErrorMessage(char*); } void A::setErrorMessage(char* errMessage){ // code here to set B::errMsg } class B{ public: A someObject[3]; char* errMsg; } int main(int argc,char** argv){ B something; B another; something.someObject[2].setErrorMessage("BIG ERRAR!"); another.someObject[0].setErrorMessage("everything's okay!"); cout<< something.errMsg<< endl; cout<< another.errMsg<< … | |
Hi I have been working on a project that requires me to be able to search a file for all occurrences of a string and store the entire line that contains a single occurrence of that string a an array of characters. For example: Search: web File: Time James [U]Web[/U]ster … | |
If I do this, I get "warning: address of local variable returned". [code] unsigned char* CharArray(void) const { unsigned char arr[3]; arr[0] = R_; arr[1] = G_; arr[2] = B_; return arr; } [/code] So the reason for that is that the memory allocated for arr[] is only available within … | |
i need help using the following .h file to Write a definition of a member function void complementSet(); which for a set A, the complement of A is the difference of U-A, where U is the universe set. Would the universe set be the monthsSet istself?? Thank you all very … | |
Each time the program goes through a loop, nameField gets bigger and bigger. Strcat keeps adding new names to the field. How can I clear the field after each output? I thought it was something like nameField = {' '};...but that doesn't work. There has to be a simply way … | |
I'll start any posts I make the same way, just so people know that I'm NOT trying to get homework done... Before I begin, let me start by saying that this is NOT homework. I am also not enrolled in a C++ class. I am simply trying to learn C++ … | |
Hi, all Like i asked before, This thread is about Memory Leak. I am a beginner in c++ and want to become a senior programmer. When i was coding, i found the memory leak is happening everywhere and maybe some senior programmer also have this problem. So i want to … | |
I'm writing a simple networking application. I'm using berkley sockets and was wondering if there was a way to enable the UDP w/ ACK option when setting up a udp socket. I know the UDP protocol has an field (in the options area) to enable it but I'm unsure on … | |
I am doing an assignment that has to use a class dayType. The program has to set the day, print the day and return the next day. I am receiving the error: --------------------Configuration: Program9 - Win32 Debug-------------------- Compiling... Program9.cpp C:\Documents and Settings\Faculdade\ISM3232\Assig9\Program9\Program9.cpp(45) : error C2447: missing function header (old-style formal … | |
Hi, all i am reading some memory leaking problem articles now. Here is one question i can't understand: [code=c++] char *a= new char[10]; char *b= new char[10]; b=a;//pointer assignment delete []b; [/code] In this article, it mentioned that the pointer assignment have side-effect and we couldn't delete pointer b from … | |
I'm having frustrations with C++... when I try and compile my code (as simplistic as it is), I keep getting a 'Shape' not declared error, but I'm fairly certain that I've written it correctly. shape.h [CODE]#ifdef shape_h #define shape_h using namespace std; class Shape { public: Shape(); virtual ~Shape() = … | |
Hi all, I have written a C++ code that reads data (as double) from a huge binary file with size 2.5 GB, then process the data and write it to another binary file. What is really strange, the code works fine and smooth in Borland C Builder 6, but since … | |
Hello all smart people! My problem is that the code below somehow should be able to summarize the [I]double betalat_andras[/I] and the [I]double skyldig [/I](not with each other) for each specific person. That is if a Person Bob is added with [I]betalat_andras = 1 [/I]and [I]skyldig = 2[/I] and then … | |
I have a project and am hung up at the moment. I am supposed to read from a file containing all of the function calls that I need to make. For example: Insert(33) would call the Insert function with an int paramater 33. How can I read this in from … | |
Hi I'm a new user of c++ and our professor gave us a homework problem where we have to find the standrad deviation, the min, the max and the avg of an array of numbers, here is what I have so far but now I'm really stuck trying to make … | |
What memory model does Dev-Cpp follow...? And how can I change it to have a segment more than 64 KB of memory....? I need it as my program stops executing in between and throws an exception - "Process returned -1073741819c(0xC00000005)" Same thing happens in Code Blocks.... So i need to … | |
How to detect USB Drive & its letter by reading register key values in EVC++ 4.0? The location of register of local mount point is: The HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices Thanks | |
I know that it is possible to output and get input from the console without using iostream and it's cout and cin using the Windows API. I don't know how to do this because I'm new to c++ but I know it has something to do with kernel32. Can anyone … | |
| I am trying to mimic the behavior of Language Indicator pop-up menus (which pop-up when you do left or right mouse click on the Language Indicator), so the foreground window and focus do not change, and it is still possible to use keyboard to select or cancel menu (arrow keys … |
ok so my compiler is doing something weird, for this like of code it is thinking the \d is a command like \n but that is a cstring, and it uses each char to decode a message to Attack at dawn!, but comes out missing the c, any hits or … |
The End.