51,592 Topics
![]() | |
Hello guys.. I have this tutorial that i keep getting errors on no matter what i've tried.. Would someone kindly check it out for me?! Here is the question: [B]Q1:- Write a program that reads students’ names followed by their test score. The program should output each student’s name followed … | |
I am amost done with the code but I need a little bit more help I need to add the bubble sort code & write exchange increment line and add the selection sort code & write exchange increment line, but I don't know how to do it can anyone help … | |
Hey all. I'm really new to programming and would like some help, if you all don't mind ;) I'm not actually having trouble with the programming, but rather, what I'm being asked to do. Here is what I'm supposed to do (and yes, it is an assignment, but I'm only … | |
i am using turbo c++. can you please tell me how to make two or more cpp or exe file together one. | |
Hey guys, i'm confused... wat's e diff btn [B][COLOR="Green"]LPD3DXMESH [/COLOR][/B]and [B][COLOR="green"]ID3DXMesh[/COLOR][/B]? Including their uses and so forth... help me understand e diff. Ok, i'm learning Direct X 9. Thx in advance! :icon_smile: | |
When I try to compile this: [code=c++] void *BaseEnt::GetVar(char const *varname) { char name = *varname; switch(name) { case "id": return (void*)id; case "name": return (void*)name; case "count": return (void*)count; default: return (void*)NULL; } } [/code] I get these errors: [code] ------ Build started: Project: Test Classes, Configuration: Debug Win32 … | |
Why are there so many people doing c++. I've heard even from c++ coders, that python is better. Is this maybe because c++ has been around longer? What do you think the future of python is? Do you think It will eventually beat out c++? | |
![]() | Hi! I make c++ programm for school and I have problem with array rotation for 90 degree. I make array rotation from one example, but there is an array rotation on wrong way, I need to make it to rotate to other way. So please help me. Here is code: … |
[CODE]#include <iostream> using namespace std; int main() { int TESTS = 0; int testScore[TESTS]; int testNum = 0; int a; double total = 0; double average; testNum = 0; cout<<"How many scores are there? "; cin >> TESTS; cout<<"Enter a score: "; cin >> testScore[testNum]; while(testNum < TESTS && testScore[testNum]) … | |
Write a C++ program that ask the user for the name of a file. The program must have a function that prompt the user to enter a file name and open the file. The program should display the last ten lines of the file on the screen. Each line of … | |
Hi guys: The following code is supposed to the following: 1 - Receive a random number and divide the number by 1000 2 - Then it needs to check if the number is greater than the series number and the cut point and convert the divided random number to either … | |
My question is, how do you calculate the "Completion Time" as I am alittle confused about it. Do I add the service times and the result is the completion times? Thank you to anyone who helps Jobs --- Service Time -- Arrival Time -- Wait Time J1 --- 2 --- … | |
If I have the class name in a string varibale, how can I instantiate an object of that class? I am just thinking of COM and CORBA implementations where C++ object is instantiated from the data in the stream. How can I implement it? | |
Hi! I'm currently taking a computer programming course at Wagner college and I have a project due this week that I am completely stumped on. these are the guidelines: [I]This will be a something like a “compatibility program”. 1) You will ask the user their name, and store it. 2) … | |
Recently, I stumbled across WinBGIm and decided to resurrect a small game I had made in turbo C++ a long time ago. Anyways, I succesfully got WinBGIm, did the necessary steps. After removing all the errors and building the project in Visual Studio 2008 Professional, I get this error (with … | |
I have got an example for cplusplus.com for converting a string into a char array so i can split in into tokens and adds to a vector and it works fine in the main method but if i try and create a separate function and pass a string as a … ![]() | |
[code] float decimal = 2.345324 float dec_points = decimal%1; [/code] hey guys, I have a small but trivial problem... i have been trying to do the above but i keep getting a error... "error C2296: '%' : illegal, left operand has type 'float'" Anyone got a clue? Thanks guys! | |
I'm drawing a sphere and some ground. I used GL_POLYGON to draw a rectangle and colored it green. When I added a sphere, my ground just turned black. Is this because the sphere is a 3d object and the polygon is 2d or is there something else? Here is the … | |
please if any one can help me ....i need a radix sort code for names..... all the names are data members in (node class) i just cant write the code so if any one can help me ..... | |
[CODE] D:/Documents/NetBeansProjects/cap/main.cpp:33: undefined reference to `_imp__pthread_create' D:/Documents/NetBeansProjects/cap/main.cpp:34: undefined reference to `_imp__pthread_create' D:/Documents/NetBeansProjects/cap/main.cpp:35: undefined reference to `_imp__pthread_join' D:/Documents/NetBeansProjects/cap/main.cpp:36: undefined reference to `_imp__pthread_join' build/Debug/MinGW-Windows/main.o: In function `Z8cancelerPv': D:/Documents/NetBeansProjects/cap/main.cpp:47: undefined reference to `_imp__pthread_kill' D:/Documents/NetBeansProjects/cap/main.cpp:48: undefined reference to `_imp__pthread_exit' D:/Documents/NetBeansProjects/cap/main.cpp:51: undefined reference to `_imp__pthread_exit' [/CODE] this is the error i got when i compile … | |
HI can anyone help me to write this programe in c Q ; WRITE A PROGRAM TO DETERMINE AND PRINT THE SUM OF THE FOLLOWING HARMONIC SERIES FOR A GIVEN VALUE OF N; 1+1/2+1/3+14+....................1/N THE VALUE SHOULD BE GIVEN INTERACTIVELY THROUGH THE TERMINAL | |
Can I have a FOR Loop of in the following manner:[for(int i=0;(s[i]!='\0')|| s[i]!=' ';i++)][/CODE=C++] where 's' is a character array | |
Hey guys, I'm trying to write something to a .txt file from within my program using ofstream. I have this function names show_results() which is a bunch of cout statements that are connected to a class and a bunch of member functions. But the function show_results is all cout statements. … | |
I dont know whats wrong with my code.. when i entered the value,there was nothing appeared on my screen.. I've tried put the single quote like this one : case '1' : cout<<Very Acidic; break; ..but it was only works for the acidic value..When i entered the value more than … | |
Hi, this C program is to remove duplicates. HOwever it doesnt always print out a result and when it does it screws it up sometimes. [CODE]# include <stdio.h> # include "simpio.h" # include "genlib.h" main() { int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,word; word=getchar(); a='a'; b='b'; c='c'; d='d'; e='e'; f='f'; g='g'; h='h'; i='i'; j='j'; k='k'; … | |
I am trying to read a decimal as a char and store it in an array by ignoring "." like if I have 0000.9876 will be stored as 9876. The program works fine...but it doesn't stop when i debug it.....I need help please ........... #include<iostream> #include <ctype.h> using namespace std; … | |
Sort a book list in a library based on the discipline USING C ++ programming? | |
I trying to write a program that uses a getline to read from a txt file. I need it to read from the file until it reaches a line that has "$$$" in it. I can get it to read in the file like this no problem. [CODE] //assuming all … | |
Hello to all, can anyone please explain to me the following: I know how to use the copy constructor, I know that it's used only in the initialization, when i wanna initialize a new object using an old object... But what I don't understand is how will I know when … | |
i not sure what is the single quote means... the example like this : if (value=='a') Thank you 4 helping :) | |
Hi there, Being a newbie to C#Net 2003, I am having problem trying to retrieve data from a specific clicked row on the DataGrid to display the data on the TextBox on the FORM. This is the structure of the DataGird:- Col0 = CustomerId Col1 = First Name Col2 = … | |
for the XsineX function I have to calculate xsinx for each value in x then store in result. I need to call on the sin function to do calculations. I tried but I know its completely wrong, any help please?? [icode] #include <iostream> #include <cmath> using namespace std; // uses … | |
Could someone please help me figure out what is wrong with my program? # include <iostream> # include <string> using namespace std; void water_state(); float celsius_to_fahrenheit(float c); float celsius; float fahrenheit; int main() { float celsius; float fahrenheit; cout << " Enter Temperature in degrees celsius: "; cin >> celsius; … | |
Hi.. Is that possible to us to set the range using the switch statement? For example i want to do this : if ph==7 is neutral if ph<7 is acidic if ph>7 is alkali could i just write like "case ph<7 :" i know i could do the case one … | |
Hello I am not sure if my function below will completely delete a linked list. I am worried it will delete every element of the list except for the head(first node)? For example; If I have this linked list below [QUOTE] L -> 1 -> 2 -> 3 -> 4 … | |
Sorry for a duplicate post. The other post had gotten messy and since I was not allowed to delete it, I am starting a new post. Hi, here are the errors I am getting when i compile on cygwin. It is weird that the code compiles and runs perfectly on … | |
ran into a problem i know this is asking for me to calculate the product of a coulmn and row but im not sure where to begin. I know that rowData tells us the value in a row and nRows specifies the number of rowData and the same with nCols … | |
I want to test the code i wrote which is part of my assignment double sine(double x, double tolerance, int & limit) { int a = 1; double b = x; double z(0.0); do { b=(-z*x*x)/((2*a)*(2*a+1)); z=b; z+=1;} while(fabs(b-z)>tolerance); limit= a; return b; } im supposed to use a main() … | |
Hi, I'm having a little problem in my loop with the string array. I want to take a record for some student, but when I loop the function, the getline() did'nt work. It only work at the first loop, then it will skip it. My code is like this [CODE]#include … | |
I'm newish to c++ and even newer to ubuntu I tried linking and this is what I got: g++ -o calculator *.o -lcrypt -lm main.o: In function `main': main.cpp: (.text+0x1ea): undefined reference to `SAMSErrorHandling::Initialize()' main.cpp: (.text+0x2fa): undefined reference to `SAMSErrorHandling::HandleNotANumberError()' main.cpp: (.text+0x322): undefined reference to `SAMSPrompt::UserWantsToContinueYOrN(char const*)' collect2: ld returned … | |
I have gotten started on my while loop but I'm kinda stuck I dont know where to go from here :( My assignment is to write a program to read in 6 numbers from the keyboard and then indicate whether any of them were larger than 500 or smaller than … | |
I know this is probably a really easy question, but my teacher failed to mention how to do it, so here goes. I'm making a simple program that tells a user if a sequence of given numbers are even or odd. Here's what the program should look like: [CODE]Enter a … | |
Hey.. I wanna make a calculator .. which takes input as a string... example: Input : "1 + 2" Output: 3 "1+2" is passed as a parameter which is in the format of a string. The return value is 3 which an integer format. calculator needs only to perform +,*,-,/ … | |
Hi, here are the errors I am getting when i compile on cygwin. It is weird that the code compiles and runs perfectly on Visual Studio. $ g++ -o mainUnix.out mainUnix.cpp [code]mainUnix.cpp: In function `int main()': mainUnix.cpp:47: error: expected primary-expression before numeric constant mainUnix.cpp:47: error: expected `;' before numeric constant … | |
hey, had a question that I couldn't figure out. I'm writing a program for linux and I need to save things to a person's Desktop. Because of that, I need to know their username. I am aware of the linux commands whoami, id, etc, but they only print the current … | |
I'm reading this one book on c++ and am having difficulty making an executable. I'm a n00b at c++ and Ubuntu so I don't know what I'm doing wrong. I've compiled all my cpp files into object files and now I need to link it but when I try that … | |
![]() | For part of my assignment, we are to write a function that overloads the * operator so that we can multiply 2 list<short int>. We are given the BigInt.h and part of BigInt.cpp (It'd be easier if we didn't have to use this format, I know, but we're supposed to … |
i'll start typing a command in the telnet module to communicate with my telnet server after i've already been connected and the server will suddenly drop me, exit telnet, and bring up the cmd prompt. what in this code is doing this? [code]void do_handleclient(int connsock,struct sockaddr_in *client_addr) { // Communicating … | |
I wrote a program to solve a system of linear equations. It works fine with the VS compiler. But when I try to run it using Cygwin, I get a seg fault(core dumped). But it does not say where the seg fault is. I am using the following commands: to … |
The End.