49,757 Topics

Member Avatar for
Member Avatar for acerious

Hello DaniWeb, This is my first real assignment and am having problem with it. The program must accept a userID and pass from user. The program must also read the userID and pass from file and if it matches the one on file, the program must display success message. The …

Member Avatar for acerious
1
3K
Member Avatar for usustarr

I have a dynamic array which will be updated from a different test system. I am havign hard time with syntax. Can someone please help me here? Here is where I declare my vector [CODE]void TestSystem::Drive(U32 RunMode, U32 Options) { //U32 is unsigned 32 bit U32 condition; U32 i; U8 …

Member Avatar for usustarr
0
234
Member Avatar for cableguy31

I'm writing a program that will parse and print packet information from a tcpdump file. One of the fields is the timestamp, which is in seconds. The program is reading the timestamp into an unsigned int type. I need to be able to convert the timestamp in seconds to a …

Member Avatar for Ancient Dragon
0
140
Member Avatar for Nathaniel10

Me Again! This program is for exercise 5) of chapter 9 in Stroustrup's book. It was a challenge for me. I gave up on trying to use [code]getline()[/code] because it required substantial parsing of the line before I could use the input. I will add it when I am more …

Member Avatar for mrnutty
0
128
Member Avatar for aaronmk2

I'm getting error: no match for 'operator>>' in 'std::cin >> aTable[i][j]' for [CODE] #include <iostream> using namespace std; const int NUM_ROWS=15; const int NUM_COLUMNS=15; typedef int TwoDimArray[NUM_ROWS][NUM_COLUMNS]; void printTable(int rows, int cols, TwoDimArray aTable); int main () { int rows, columns; TwoDimArray aTable[rows][columns]; cout<<"Enter rows and columns"; cin>>rows>>columns; for (int …

Member Avatar for Fbody
0
508
Member Avatar for saloth

Hi, i'm making a simple texteditor from VB6, and i use Visual C++ as my back end. i call a function where in I will read another text file and put it in a structure. this is the function: void loadR() { ifstream file; file.open("C:/CaseStudy/CaseStudy/Rsrvd.txt",ios::in); for (i=0; i<44; i++) { …

Member Avatar for ftl25
0
191
Member Avatar for ravi_shekhar06

[code]#include <stdlib.h> // include <stdlib.h> rather than <cstdlib> for mkstemp #include <fstream> #include <vector> #include <algorithm> #include <ios> #include <ostream> #include <cstring> #include <sys/stat.h> #include <sys/types.h> #include <signal.h> #include <sys/socket.h> #include <arpa/inet.h> #include <unistd.h> #include <netdb.h> #include <netinet/in.h> #include <errno.h> #include <pthread.h> #include "socket_server.h" #include <c++-gtk-utils/shared_handle.h> #include <c++-gtk-utils/callback.h> #ifdef HAVE_STREAM_IMBUE …

Member Avatar for Fbody
-1
174
Member Avatar for abdelhakeem

Hello all, I and my friend are preparing for a small OS, He's currently making the bootloader, and i'm making a Portable Executables(PE) Loader that reads PE file (EXE, DLL, OCX) and executes them... My questions are: 1) Can this PE Loader execute Win32 programs on non-Window OS? 2) If …

Member Avatar for abdelhakeem
0
83
Member Avatar for low_coder

Hey everyone! I'm writing some program and im using a vector tp hold pointers to objects.. i will create new instances of the objects and my code should automatically destroy each object present in the vector. theres three types of classes stored in the vector : BaseClass, ChildClass1(inherited from BaseClass) …

Member Avatar for low_coder
0
119
Member Avatar for ftl25

Hi guys, I need to write a piece of code which takes two strings (char arrays) containing hex values and perform an AND operation on them. (The aim is to mask bits from the first value). A Mask value of all Fs means that we don't want to mask any …

Member Avatar for ftl25
0
112
Member Avatar for johnray31

Hello guys, I want to use structure as a map key , is it possible? Or is there any work around in c++ to do this or am i doing something wrong? I was trying to do this. [CODE] #include <iostream> #include <map> #include<stdint.h> #include "stdio.h" using namespace std; struct …

Member Avatar for Narue
0
101
Member Avatar for harvybcn

This is about a C++ problem.[CODE][/CODE] I have an object tracking program that takes images from 0,...,n in a loop. At current frame the computations are based on previous frames, therefor I need to hold those variables, matrices, etc for later use. This program has to be integrated now into …

Member Avatar for Fbody
0
182
Member Avatar for praky

I have a string in char a[100]=00110010 which is the ascii code of '2'. Now i want to write this in a text (or binary) file as binary bits. So that when i open the file in binary mode and read a character char ch say via [CODE]ifstream fin; fin>>ch; …

Member Avatar for abdelhakeem
0
104
Member Avatar for Kostan M

Hi...I'm a new one in C++. Would you like to explain how to plot graph in C++?? There are any web will help me to do it??? Thanks!!!

Member Avatar for Valaraukar
0
67
Member Avatar for martin_anastaso

Hello all, I am getting the following linker error when I try to pass an object of type "string" to a function. Otherwise, the code compiles correctly. exercise_3.10.obj : error LNK2019: unresolved external symbol "void __cdecl reshuffle(unsigned int,unsigned int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?reshuffle@@YAXIIV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function _main Here is …

Member Avatar for martin_anastaso
0
205
Member Avatar for applepomme

for (i=0, i<imax, i++) { // ... Array< complex<float>, 3 > matrix(x,y,z); // x,y,z are large and vary in each loop // ... // matrix <=== values for each element assigned // ... // now want to write "matrix" in a single binary file. // later, this matrix can be …

Member Avatar for chiwawa10
0
187
Member Avatar for hurbano

im trying to run this code that adds a name and displays it. i keep getting the same message. can anyone tell me what i have done wrong? thank you. [code=cplusplus] #include <iostream> #include <string> using namespace std; class treenode { public: string data; treenode * left; treenode * right; …

Member Avatar for chiwawa10
0
131
Member Avatar for solitaryy

Hi I have a file (.txt) I need my program to read that stores information like this: [CODE]Thomas 2000 Bill 3000 Jake 3500[/CODE] At which point I need to have the user input via cin, [I]name of the person[/I] ie: Jake and have them input another cin(double) which will multiply …

Member Avatar for chiwawa10
0
91
Member Avatar for tylermlarson

I have to do a program for my C++ class, and we have to write all programs using gedit on ubuntu and run them all using the terminal command prompt. I dont know what the whole ./a.out is, and all i have for my program is [CODE]// This program will …

Member Avatar for VernonDozier
0
115
Member Avatar for alcx88

[CODE] #include <stdio.h> 5 6 #define MAX 100 7 8 int main(void) 9 { 10 char msg1[MAX], *p, *q, msg2[MAX]; 11 12 printf("Enter a message: "); 13 for (p=msg1; p<msg1+MAX; p++) 14 { 15 *p=getchar(); 16 if (*p=='\n') 17 break; 18 } 19 20 for (p--; p>=msg1; p--) 21 { …

Member Avatar for chiwawa10
0
92
Member Avatar for skecher
Member Avatar for chiwawa10
0
90
Member Avatar for MisterBook

I've written a flexible quicksort module capable of taking a vector reference pass, cloning it, altering the clone and swapping with the original to print the list. For the most part, this works wonderfully, except for one thing. Occasionally, it gets numbers wrong. Not all the time. If I give …

Member Avatar for MisterBook
0
131
Member Avatar for kes166

Hi there! My name is Ken, and I'm an old (not age) C++ programmer. I went to school for it, and it's been about 7 years since I've actually programmed anything hard, so I figured a forum would be a great place to relearn alot of it by teaching what …

Member Avatar for niraj_sharma
0
152
Member Avatar for nschessnerd

Hi, I have the following managed c++ code: [code=cplusplus] DWORD addr=(obj.addresshigh*0x10000)+obj.addresslow; [/code] and i use this address to read memory in a program.. However I noticed it was crashing because it's adding wrong. Ie: obj.addresshigh=4006 obj.addresslow=d6b4 however addr ends up as 4005d6b4 the weird thing is this doesnt always happen, …

0
46
Member Avatar for LevyDee

Im trying to create an object of my CAMERA class in my APP class, but I am getting the error: error C2146: syntax error : missing ';' before identifier 'myCam' error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C4430: missing type specifier - …

Member Avatar for LevyDee
0
109
Member Avatar for chromos

amateur programmer here looking for some pretty basic help from the community. I am completing a program which is supposed to calculate the total monthly/annual cost for a vehicle; mind you, it's meant to be simple, but I probably shoot myself without noticing... [CODE] #include <iostream> using std::cout; using std::cin; …

Member Avatar for gerard4143
0
88
Member Avatar for GooeyG

A company has four sales people (1 to 4) who sell five different products(1 to 5). Once a day, each salesperson passes a slip for each different type of product sold. Each slip contains the following: a)the salesperson number b)product number c)total dollar value of that product sold that day …

0
85
Member Avatar for applepomme

I used this to write the matrix into a file: int Nx, Ny, Nz; Array <complex<float>, 3> matrix(Nx, Ny, Nz, ColumnMajorArray<3>()); ...get matrix data... fstream outbin(outname.c_str(),ios::out|ios::binary); outbin.write(reinterpret_cast<char *>(matrix.data()),sizeof(complex<float>)*Nx*Ny*Nz); outbin.close(); Then, I used this to read this matrix, works fine, values and orders are correct too: Array <complex<float>, 3> matrixb(Nx, Ny, …

0
82
Member Avatar for bmos31

I was just wondering how to pass two objects s1 and s2, both of which have to arguments, to a function, someFunction(). I actually only want to pass the second argument of each object for s1 and s2 to the same function, compare the two arguments and then display some …

Member Avatar for bmos31
0
165
Member Avatar for CodyOebel

I am programming in windows api, and I am familiar with using the ScreenToClient() function, and passing in a POINT structure variable for LPARAM with the coordinates defined in the point struct to simply send mouse clicks and so forth to the window in which I have the handle to. …

Member Avatar for CodyOebel
0
139

The End.