49,761 Topics

Member Avatar for
Member Avatar for thefonz22

Hi guys. There seems to be a lot of people on this forum who know what they are talking about. My question is simple. I'm fairly new to c++ and i have hit a brick wall. I'm trying to write a simple program that grabs 2 txt files and outputs …

Member Avatar for ken.green.142035
-1
2K
Member Avatar for abb13e

I dont clearly understand bool functions. this lends problems to my current assignment in class where i have to write a program that involves a bool function that tests for letters in a string that the user inputs. Can anyone offer help to me? the whole code is slightly confusing …

Member Avatar for abb13e
0
274
Member Avatar for kshahnazari

hey , I'm trying to read a 24 bit bmp file but after reading the first pixel something goes wrong, any ideas? int i; FILE* f = fopen("Sample.bmp", "rb"); unsigned char info[54]; fread(info, sizeof(unsigned char), 54, f); // read the 54-byte header // extract image height and width from header …

Member Avatar for triumphost
0
7K
Member Avatar for Sarkurd

Hi what are Macros used for in C++? i never heard this word in my entire life :D and what are `assert()` and `NDEBUG`?

Member Avatar for Sarkurd
0
175
Member Avatar for Asma_2

i need your help to find c++ code for Clustering algorithm for energy efficiency in wireless sensor networks

Member Avatar for L7Sqr
0
275
Member Avatar for yapkm01

I know that there's no solution book for C++ Primer 5th Edition by Stanley Lipmann but is there any on the web? Would appreciate any help on this. Thanks.

Member Avatar for deceptikon
0
72
Member Avatar for kshahnazari

Hi , I have a small 2d array and I want to check if it exists in a bigger 2d array. I have coded it but I don't know what am I doing wrong cause even if exists it won't detect it. 2 arrays are PI and NPI. PI is …

Member Avatar for Hiroshe
0
206
Member Avatar for yogesh_6

This program hangs when I enter the number of vertices only..It does nothing..I am not able to figure out what's wrong with this.Please help #include<iostream> #include <list> using namespace std; // This class represents a directed graph using adjacency list representation class Graph { int V; // No. of vertices …

Member Avatar for rubberman
0
705
Member Avatar for nhrnjic6

OK. I just don't understand what is the problem here. Here's the code .h file : #ifndef NVECTOR_H #define NVECTOR_H class Nvector { public: //Nvector(); Nvector(int Size = 0); void addElement(int a, int index); void getElement(int index); void push_me_back(int a); void push_me_front(int a); private: int *p_array; int velicina; int *resize_array(int …

Member Avatar for nhrnjic6
0
300
Member Avatar for daniela.valkanova

int game() { int n; cout << "enter an odd number: "; cin >> n; int MagicSquare[n][n]; // It says that the expression must have a constant type? int newRow,newCol; int i = 0; int j = n / 2; for (int i = 0; i < n; i++) { …

Member Avatar for tinstaafl
0
291
Member Avatar for cambalinho

heres the code that i use for put the form transparent: LONG style= GetWindowLong(hwnd, GWL_EXSTYLE); style=style | WS_EX_LAYERED; SetWindowLong(hwnd, GWL_EXSTYLE, style); SetLayeredWindowAttributes(hwnd, clrBackColor, NULL, LWA_COLORKEY); but i see problems :( the form and the controls are showed, but the mouse events are ignored. if i click on button or form, …

Member Avatar for cambalinho
0
6K
Member Avatar for Daneos

Hello, anyone can suggest me a simple lua wrapper with clean code? I want to call from c++ lua functions but I dont really get it.. I only know a little LUA and C++. Example lua function I have: Get the level: function Lv(a) local lv = GetChaAttr( a , …

Member Avatar for AceStryker
0
278
Member Avatar for rela

I am a beginner, and want to know how can run the code in notepad with visual studio. I tried with a simple code by --<<All Program -->microsoft Visual --> visual Studio tools --> visual Studio command prompmt. The error is: ''fatal error C1083: cannot open source file: filename.cpp: No …

Member Avatar for NathanOliver
0
694
Member Avatar for ivan3510

Hi! So, I made this code #include<iostream> #include<cstdlib> #include<pthread.h> using namespace std; const int m=6; const int n=5; const int s=5; const int r=8; const int num_thrd=3; class data{ public: int* A; int* B; int* C; int start; }; void* multiply(void* pod) { data* P=(data*)pod; for(int i=P->start;i<m;i+=num_thrd) { for(int j=0;j<r;j++) …

Member Avatar for ivan3510
1
211
Member Avatar for Sarkurd

Hi i tried to test some new features of C++ 11 but how come Visual Studio doesn't support `constexpr`? i tried this simple function but it won't compile constexpr int multiply(int x, int y) { return x * y; }

Member Avatar for Sarkurd
0
1K
Member Avatar for yazici.batuhan

Consider a stack module like (two files stack.h stack.cpp) which supports the these functions; void push (stack *, std::string); std::string & pop(stack &); bool isEmpty(stack &); std::string & top (stack *); I didnt understand this part what it means. Also I declared stack like; struct stack { … }; But …

Member Avatar for Moschops
0
321
Member Avatar for davecoventry

Forgive me if this is somewhat basic. If have an array of 20 strings defined: char const commands[20][20] = {// each command string will have a maximum of 20 chars. "quit", "open", "save", "close" }; I want to test the command value to see what action should be taken. int …

Member Avatar for NathanOliver
0
300
Member Avatar for sonu_1

hi to all user i am new in file handling , i know file handling but not much , my instructor taught me that use binary search tree in a file to search key value ,key value(like any thing such that record can be easily make out and comparision can …

Member Avatar for Rizwanrana786
0
400
Member Avatar for userasad

I have a text file and i want to replace a word from a specific location. For example want to replace 5th word from 12th line of file. How i can do that?

Member Avatar for Rizwanrana786
0
258
Member Avatar for surfingturtle

Dear members please help me in understanding the control flow in the following code, thanks #include <iostream> class constructs #include <iostream> class constructs { char inp; public: void acceptCharacter() { cout<<"Enter a character: "; cin>>inp; if(inp>='A') //ASCII value of A = 65 if(intp<='Z') //ASCII value of Z = 90 cout<<endl<<"Uppercase"; …

Member Avatar for surfingturtle
0
296
Member Avatar for anas930

how i plot the sensor(mpuc6050) coding in c++.and i want a program that show 2 sticks in dos screen...

Member Avatar for Hiroshe
0
49
Member Avatar for christinetom

Hi everybody. I hope nobody is working too hard. I am trying to figure out a way to use the peek() method of the stringstream class but looking more than one place forward. For example, if I use stringstream.peek() it will let me know the value one value ahead of …

Member Avatar for christinetom
0
2K
Member Avatar for myk45

Hello. Well, im a little confused as to what exactly the terms Data Abstraction and Data Encapsulation mean: This is what i read: [B]Data Abstraction[/B]:data abstraction is a process of representing the essential features without including implementation details. [B]Data Encapsulation:[/B]: Data encapsulation, also known as data hiding, is the mechanism …

Member Avatar for naaz.kaushik.3
0
874
Member Avatar for low1988

Hi, I have been assigned to a system integration project. However, I do not understand part of the integration implementation arhitecture. For example, I have a passport scanner connected to a Windows Client application constructed in C++. The client application would going to pass the passport picture, name, address etc, …

0
80
Member Avatar for Alxprog

Hi! Have anybody seen Scot Meyers' video on Universal references? In order for a reference to be "universal" two requirements should be fulfilled : 1)variable should have double ampersand after it's type : sometype&& 2) the type should be deduced . The second point is somewhat confusing to me: despite …

Member Avatar for mike_2000_17
0
326
Member Avatar for Daneos

Hello, I need for my game inventory function a mysql query which checks the next available free slot id. example: I have item on slot 1, 2, 3 and 5. Slot 4,6,7,8,9 ... are free.. Now I need query which would get the number 4. Something like SELECT * FROM …

Member Avatar for NathanOliver
0
347
Member Avatar for daniela.valkanova

> This compiles but does not show me any results? Why #include <iostream> #include <cmath> using namespace std; void dist(int x1, int x2, int y1, int y2) { double r1 , r2 , d ; r1 = sqrt((x1*x1) + (y1*y1)); r2 = sqrt((x2*x2) + (y2*y2)); d = sqrt((x2 - x1)*(x2 …

Member Avatar for NathanOliver
0
1K
Member Avatar for daniela.valkanova

void init1() { static int yrs = 1; cout << "The value of yrs is " << yrs << endl; yrs = yrs + 2; return; } void init2() { static int yrs; yrs = 1; cout << "The value of yrs is " << yrs << endl; yrs = …

Member Avatar for daniela.valkanova
0
148
Member Avatar for daniela.valkanova

#include <iostream> #include <cmath> using namespace std; double dist(int x1, int x2, int y1, int y2) { double r1 , r2 , d ; r1 = sqrt((x1*x1) + (y1*y1)); r2 = sqrt((x2*x2) + (y2*y2)); d = sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1)); cout << " …

Member Avatar for daniela.valkanova
0
283
Member Avatar for daniela.valkanova

> Write a C++ function named fracpart() that returns the fractional part of > any number passed to it. For example, if the number 256.879 is passed to fracpart(), the > number 0.879 should be returned. Have fracpart() call the whole() function you wrote in > Exercise 12. The number …

Member Avatar for daniela.valkanova
0
360

The End.