49,757 Topics

Member Avatar for
Member Avatar for egboy

Dear Guys, I used the Visual Studio before to send and receive some I/O signals using a parallel port cable, now i would like to know how to do this using serial port specially USB. In conclusion, how to send and recive signals with USB cable. thanks

Member Avatar for Salem
-1
92
Member Avatar for Liszt
Member Avatar for Liszt
0
110
Member Avatar for ribena500

Hi I got this code: (hours_worked[i]-35)=overtime_hours[i]; (overtime_hours[i])-(hours_worked[i])=normal_hours[i]; I get this error: error C2106: '=' : left operand must be l-value What does this mean?

Member Avatar for Salem
0
71
Member Avatar for jerronimo3000

ok, i'm still on Hello World because of this. I can compile and link my app without any warnings or errors, but when I run the .exe it will come up with a black box that prints Hello World and then dissappear. It comes up and terminates in less than …

Member Avatar for VernonDozier
0
122
Member Avatar for Dendei

Hello i need some help to understand my work heres the code [CODE] #include <iostream> #include <string> #include <sstream> #include <vector> #include <fstream> using namespace std; struct cell1 { int value1; } cell1Data; struct cell2 { int value2; } cell2Data; int main(void) { ifstream myfile("example.txt"); if(!myfile.good()) return 0; vector<cell1> data1; …

Member Avatar for Freaky_Chris
0
103
Member Avatar for Liszt

I have done a windows form application that I have debugged in "Release Mode". I need to ask 2 questions at the same time because I think they depend on eachother and that is my questionmark: 1. When starting this program, there will be a panel visible where you will …

Member Avatar for Liszt
0
131
Member Avatar for denni11998833

Hey, I was wondering if someone could help me out here! I am trying to sort a list of files and remove the last x ones if it exceeds a constant variable (maxbuffersize). Below you can see what I did: I tried to sort the vector based on the predicate …

Member Avatar for denni11998833
0
2K
Member Avatar for seebharath

I have a a function that is written in pure unmanaged c++ . i want to convert this to a dll and use this in a c# application .. Is this possible and if so how? Can anyone please give some sample code to do this or any links. I …

Member Avatar for Ramy Mahrous
0
240
Member Avatar for azwraith69

good day everyone.. thx for reading.. this is my problem: i want to use the write() function, in ofstream, to write strings into a file.. but write() requires parameters of const char pointer and streamsize... [icode]for(unsigned i=0; i != questions.size(); i++) { qptr = &questions[i]; //vector element(string) tempfile.write(qptr, stringsize); }[/icode] …

Member Avatar for azwraith69
0
161
Member Avatar for veer123

Hi want to implement an unordered hashmap ie. FIFO implementation . Below is the code.Please help me with this. [code] #include <hash_map> #include <iostream.h> int main() { hash_map<int,int>testMap; testMap[1]=1; testMap[3]=5; testMap[2]=2; typedef hash_map<int,int>::iterator hashIter; for(hashIter it=testMap.begin();it!=testMap.end();it++) { cout<<it->second<<"\n"; } } [/code] It gives output as 1 2 5 But I …

Member Avatar for veer123
0
146
Member Avatar for maccold321

Write a program that initializes a vector with the following array values. int arr[] = {1, 6, 2, 9, 12, 15, 33, 28}; Compute the average value, and then output each value along with its deviation (+/‐) from the average. What i have so far is only the average... [code] …

Member Avatar for vmanes
0
110
Member Avatar for Ali22615

I'm trying to write a program to read lists of number from a txt file then bubble sort it in increace order and find the average of every single list. That's what i got so far #include <iostream> #include <fstream> #include <stdio.h> using namespace std; void bubbleSort(int *array,int length) { …

Member Avatar for Murtan
0
90
Member Avatar for lehe

Hi, I am new to using C and C++ libraries. So my questions might seem to be naive. 1. When installed, will the source files ( .c or .cpp) of a library be placed into some system directory like /usr/local/src/ for other code that will use them? 2. If not, …

Member Avatar for Murtan
0
130
Member Avatar for sfrider0

Hey. I have to write a Fraction class for homework and overload for the Fraction class the operators +, -, *, /, +=, -=, *=, /=, and << (the insertion operator). Can somebody please tell me what exactly the insertion operator is supposed to do? I've googled it and all …

Member Avatar for VernonDozier
0
143
Member Avatar for code46

Hello, I wrote a quicksort program that will give me the execution time of the algorithm. I was running it for 1,000, 10,000, 100,000, 1,000,000, and 10,000,000 numbers. Everything was going fine and then when I changed the amount of numbers it is sorting it gave me a segmentation fault …

Member Avatar for code46
0
209
Member Avatar for networkburner

So, I've been coding C++ for a while now, and in that time I've of course surfed the web a fair bit. Is it just me, or does everybody on the internet just hate conio.h's _getch()? I've seen a lot of forums where people are asking the best way to …

Member Avatar for Ancient Dragon
0
148
Member Avatar for mps727

Whenever I step through my code, visual studio will step into things like string, and the new operator. When it does this it also leaves a tab for the file open at the top. Is there a way to configure it to only step into code that is loaded in …

Member Avatar for mps727
0
95
Member Avatar for serkan sendur

i keep some formatting data in an array of structs. it is a very long array. is it better to keep this information in another class and inherit from this class or is it better to not inherit from this class but create an instance of that class and use …

Member Avatar for Narue
0
89
Member Avatar for aburich_44

This has only one function to solve projectile motion, but it doesnt seem like it works, why? [code] //Richard Chaaya //1-25-09 //kinimatics #include <iostream> #include <conio.h> #include <iomanip> #include <string> using namespace std; int main() { //declare variables double dblVix = 0.0; double dblViy = 0.0; double dblVfx= 0.0; double …

Member Avatar for StuXYZ
-1
121
Member Avatar for xyzt

I really can't understand why the belove code gives error. I get this error: [I][B]In function 'int* bubble_sort(int*)': error: no matching function for call to 'swap(int*&, int&, int&)' [/B][/I] May someone please show me the reason? [CODE]int* bubble_sort(int arr[]) { for(int i=0;i<sizeof(arr);i++){ for(int j=0;j<sizeof(arr);j++){ if(arr[i]>arr[j]) swap(arr, i, j ); break; …

Member Avatar for Salem
0
80
Member Avatar for Alex_

Hello, i am having a problem getting an understanding of that issue . Can someone pls offer help? I have no idea what it means(just guessing), i do know what polymorphism is though. I also want to understand what does polymorphism has to do with "the mechanism of message reporting …

0
53
Member Avatar for mahdiahmadirad

Hi Dears! I Wrote A Bubble Sort for sorting 2D array of characters. and logically it seems correct, but unfortunately not works. please help me. this is my output: unsorted: mah ali sal Sorted: ali ali mah Here is my Code so far: [CODE] #include <iostream.h> #include <stdio.h> #include <string.h> …

Member Avatar for mahdiahmadirad
0
186
Member Avatar for serkan sendur

hi guys i want to achieve something like this : in header file : [CODE]#pragma once class wef { private: int a[]; void setI(); };[/CODE] and the code file will be like this: [CODE]#include "wef.h" void wef::setI() { a = {1,2,3}; }[/CODE] could you please help me with that?

Member Avatar for serkan sendur
0
13K
Member Avatar for serkan sendur

i have a struct and i need to use an array of that struct. The member of that array is definite at compile time, so i am going to hard code them. how do i declare it in my class header file and fill the items in the class file?

Member Avatar for serkan sendur
0
285
Member Avatar for naseerkhan861

hi guys can anybody has a c++ code on permutation cipher and hill cipher ,terms used in cryptography.

Member Avatar for MosaicFuneral
0
70
Member Avatar for Mighty

[code=cplusplus] #include<iostream> #include<iomanip> using namespace std; int main () { int month, year; float totalCollected, Sales, CountySalesTax, StateSalesTax; float TotalSalesTax; std::cout<< " What is the Month:"; std::cin>>month; std::cout<<"What is the year:"; std::cin>>year; std::cout<<"What is the total amount collected at register:$"; std::cin>>totalCollected; std::cout<< setprecision (2) << fixed; float sales=totalCollected/1.06; CountySalesTax=sales*.02; StateSalesTax=sales*.04; …

Member Avatar for Salem
0
160
Member Avatar for Yaserk88

Hey. I am trying to output a file. I pretty much have down, but the only problem is I'm getting the last set of my numbers and missing the other 5000 or so sets. Here is what I have [[ICODE]for (int i=0; i < N_plates; i++) { cout << i …

Member Avatar for Yaserk88
0
131
Member Avatar for serkan sendur

i got compiler error stating that : Only static data members with const integral or const enumeration type can specify an initializer in the class definition what is the logic behind that? why is the compiler designed not to accept any non constant static initialization of types?

Member Avatar for Narue
0
110
Member Avatar for gsingh2011

Hi, what are the advantages of C# over C++? I have a little bit of knowledge in both of them, but I am going to choose which one to dedicate most of my time to.

Member Avatar for ddanbe
0
834
Member Avatar for floodemo

[code]#include<iostream.h> #include <string> using namespace std; struct sdata { char name[5]; int reg; }; struct sub { char subject[30]; sub * move; }; void instudent(sdata & ins ); void show(sdata * ins); class inf { sub * begin; sub * look(int limit) { sub *pointer=begin; for(int i=1; i<limit; i++) pointer=pointer->move; …

Member Avatar for Alibeg
0
144

The End.