49,761 Topics

Member Avatar for
Member Avatar for smitsky

Hi. Why am I getting different output when I call the calculate() function? The output on line 184 gives 1.0001, while the output from line 433 gives 1. Thanks. #include <iostream> #include <string> #include <limits> #include <vector> #include <iomanip> using namespace std; /** * Global Variables */ string k; int …

Member Avatar for smitsky
0
198
Member Avatar for admiri92
Member Avatar for Moschops
0
250
Member Avatar for Aditya_8

gimme the error plz it says undefined symbol _main in module c0.asm #include<iostream.h> class largest { private : int num1,num2,num3,big; public : void enter(int a,int b,int c); void max(void); void display(void); }; void largest::enter(int a,int b,int c) { cout<<"Enter numbers n"; a=num1; b=num2; c=num3; cin>>a>>b>>c; } void largest::max(void) { big=num1; …

Member Avatar for Ancient Dragon
0
163
Member Avatar for mR-_-EBoOo

how I can introduce printf and scanf in microsoft visual c++ 2010 express i used #include<stdio.h> , #include<isotream> and using namespace std; put it still doesnt work ???

Member Avatar for rubberman
0
126
Member Avatar for catastrophe2

hi so this project requires an input of U, M, or D and as many as you like of them (i think, might be only up to 100 based on charUMD[100] array in code) also, you have to end it with # in order to indicate the end. i am …

Member Avatar for catastrophe2
0
329
Member Avatar for mR-_-EBoOo

You are required to write a C++ program to covert a positive inter code into English name equivalent for the digit. A valid code is of size between four (4) to six (6) digits inclusive. A zero is not allowed in a code. Example: If input is 234056 the output …

Member Avatar for deceptikon
0
268
Member Avatar for Brittany_1

I really love working with structs, and I get how they work and everything. And I know my issue right now is the math (I'm horrible at math!) But my problem: I need to create a program that reads from a .txt file of employees (let's say 5) an they're …

Member Avatar for David W
0
145
Member Avatar for michelemalta

Hey all, I've been making a caesar cipher but seem to have encountered a problem. My program reads an integer from a text file and stores it as the shift value. Then my goal was to add that shift value to the alphabet array. Here is a part of my …

Member Avatar for vmanes
0
209
Member Avatar for SerenityG

Hello, I have this program that runs in C++ that I need to run in C. This is my program in C++: #include <iostream> #include <string> #include <cctype> using namespace std; char encode (char plaintext) { if (isupper(plaintext)) { if (plaintext > 'M') { plaintext += 13; } else { …

Member Avatar for David W
0
228
Member Avatar for Jake_4

Could anyone explain the problem im having on line 28, (value = amp*sin(2*pi*freq*t);) i keep getting this error message 28 11 [Error] cannot convert 'double' to 'float*' in assignment #include <cstdlib> #include <iostream> #include <math.h> #include "dp_lib.h" using namespace std; int main() { double pi=3.141592653589793238462643383279502884197169399375; float* value; unsigned long length …

Member Avatar for StuXYZ
0
4K
Member Avatar for CreatorZeus

So decided I should switch to VS13 for the added benefits. Copied the cold, transfered the files, alls good right? Wrong. Actually its not that bad. Just one main problem. `ltm` See this fella? This is the one guy that is standing in the way of me and the debachury …

Member Avatar for JasonHippy
0
242
Member Avatar for CreatorZeus

so im trying to convert my code from localtime to localtime_s. it was this: time_t now = time(0); tm *ltm = localtime_s(&now); i seem to be having some strctual errors. Can i have some help?

Member Avatar for CreatorZeus
0
5K
Member Avatar for can-mohan

Hi, While executing below code i am getting error like "memory clobbered before allocated block" and due to this assignment is not happening. could you let me know what can be reason for the same. I do understand it is not good to use raw pointer but in current scenario …

Member Avatar for can-mohan
0
443
Member Avatar for hamzabinamin

We were given a task to use lists and iterators. We were supposed to make them from scratch. I'm done with that. The problems that I'm having are as following: 1. I'm not able to access the list made of Course datatype which is present in each Student instance. Does …

Member Avatar for StuXYZ
0
208
Member Avatar for sparky58

This assignment asks to add some code from to a previous assignment I had. I have been confused about this overload operators alot and im confused on how to do it in my code any help with this will be good A) overload the >> operator to allow for reading …

Member Avatar for Banfa
0
393
Member Avatar for Curious Gorge

So I've begun using a library called Poco. My program doesn't do what its supposed to yet I've checked over everything. The code is: #include "stdafx.h" #include <iostream> #include <Poco/Debugger.h> #include <string.h> #ifdef POCO_ARCH_LITTLE_ENDIAN std::string endianness = "Host byte order is Little Endian.\n"; #else std::string endianness = "Host byte order …

Member Avatar for Curious Gorge
0
248
Member Avatar for michelemalta

I'm fairly new with arrays but from my understanding it is set up as so: datatype arrayname[#of elements] = {elements}; I was wondering why this code doesn't work typedef char alphabet[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', …

Member Avatar for nullptr
0
291
Member Avatar for Brittany_1

Hello everyone. I need some help on creating a slot machine. It needs to have the option of playing a three wheel & four wheel machine. I've created separate functions for those two. I think I understand the whole random generating concept, but I'm having a hard time figuring out …

Member Avatar for vmanes
0
571
Member Avatar for Jake_4

I am new to C++ and i don't understant this error message i am recieving. Could you show me the solution? ([Error] name lookup of 'n' changed for ISO 'for' scoping [-fpermissive]) line 25, col 17 (the 'n' is the problem) #include <cstdlib> #include <iostream> #include <math.h> #include "dp_lib.h" using …

Member Avatar for Labdabeta
0
7K
Member Avatar for abrahem.aljazazy

write a c++ programme that read an unknown number of integers value and then print count, sum and average of 1. even value 2. odd value 3. negative value 4. positive value thank you

Member Avatar for abrahem.aljazazy
-1
74
Member Avatar for bignobela

**what can i do with this errors?please help me! thanks** >#ifndef WS2811_h >#define WS2811_h >#include <avr/io.h> >#include <util/delay.h> >#include <WS2811.h> **Error 1 unterminated #ifndef** >typedef struct __attribute__ ((__packed__)) { > uint8_t r; > uint8_t g; > uint8_t b; >} RGB_t; **Error 2 expected ':', ',', ';', '}' or '__attribute__' before …

Member Avatar for sepp2k
0
170
Member Avatar for daniel1977

I have a question about classes and header files. As I see the trend of reusing classes, I would like to start building the classes in their own file, and be able to call it, and use(#include "class.h") to include them. I am a little bit confused because I understood …

Member Avatar for rubberman
0
157
Member Avatar for ckide

what do you prefere for naming: database - c++ - java - php? 1- User_id - User_Name 2- user_id - user_name 3- UserId - UserName 4- userId - userName 5- else

Member Avatar for Ancient Dragon
0
305
Member Avatar for moaz.amin.37

Assalam o Alikum my question is that what is the difference between character array and string. my instructor is use char str [50] instead of string str. and i can not understand what is difference between them.

Member Avatar for moaz.amin.37
0
364
Member Avatar for smitsky

Hi. I'm trying to implement a disk scheduling algorithm using a vector. I am able to find the smallest element of the vector with my findMin() function: int computer::findMin( vector<int> v ) { int minIndex = 0; for( int i = 1; i < v.size( ); i++ ) if( v[ …

Member Avatar for mike_2000_17
0
296
Member Avatar for Totoo

hi can u please help me solve this question. A small company dealing with transportation has just purchased a computer for its new automated reservations system. You have been asked to program the new system. You are to write a program called ReservationSystem to assign seats on a vehicle. Your …

Member Avatar for Ancient Dragon
0
270
Member Avatar for kalidas.rajendran.1

hallo everyone i am lookng for some sample c coding for fuzzy logic, can anyone help me in developig fuzzy logic in c,.. i had developed the fuzzy logic in matlab, now i need to write the code in c, looking for some sample code,..

Member Avatar for ddanbe
0
138
Member Avatar for softwaretime

Well this is quite a large program so there is a lot of information to sort through, but when I compile it now it comes up with this: /Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp: In member function ‘virtual int dbase::todo()’: /Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:393: error: invalid conversion from ‘const char*’ to ‘int’ /Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:394: error: invalid …

Member Avatar for frank.dekievit.50
1
13K
Member Avatar for sparky58

1. This assignment asks to add some code from to a previous assignment I had. I have been confused about this overload operators alot and im confused on how to do it in my code any help with this will be good A) overload the >> operator to allow for …

Member Avatar for Ancient Dragon
0
288
Member Avatar for ravi_14

i found following code to create a two dimensional array at run time if one of the dimension is known.. char (*c)[5]; c=new char[n][5]; first line is pointer to an array of 5 integers but i couldnt undesratnd the second step.

Member Avatar for Ancient Dragon
0
290

The End.