51,593 Topics
![]() | |
Dear all, I am trying to print out some outputs defined by my own in different function calls and classes into a debug file, I saw in one source code using macros like: #ifdef DEBUG_OUTPUT #define debug2 printf #else #define debug2(arg1,...) #endif and with a call to this macro like: … | |
Which is better? We're designing a new autonomous robot for the competition we attend during the summer and this is one of our topics for design. I want to do a dual-processor, multi-core computer to run the software. Some others want to do distributed computing (between two laptops). Am I … | |
I've been trying to compile a program I wrote with QT on a Mac for about a week now and I can't get it to work for the life of me. I'm very confused because the code compiles just fine on a linux machine using a core 2 duo, and … | |
guys i need your help now, tomorrow will be our submitting our program but i have some problem about my program which is the infix to postfix then getting the answer.. I have already the infix to postfix then i don't know how to get the answer, this program is … | |
i m starting to learn c++. i m trying to do a console app. this is my code but i encountered a problem with it after i key in num1 and num2 the total will be display for about a few mili seconds and the console terminate itself. if i … | |
I have been trying to follow what you guys where doing here because I have to do something simalar. Can you tell me what the name of your file is jaffo, is it a .dat or a .txt file? You where using ary, is that the file name? Acient Dragon, … | |
Hi, I'm using a program called FunEditor which compiles in C++. I doubt many people have heard of this program, but if you have, I would appreciate the help. I'm working on creating a Mario-style platformer game, and am trying to make a function where if the Player collides with … | |
Why static data member 'int' could initialize in class body? but 'double' can't? eg: [code=cplusplus] class Example { public: static double rate = 6.5; //wrong... static int versize = 20; //right } double Example::rate = 6.5; //yes [/code] What reason by design that syntax ? | |
I am working on an assignment for my Data Structures and Algotithms in C++ class. My program will take a user input string and determine if it is a palindrome. I have to use stacks in this program. My program compiles with no errors but the following warning is displayed: … | |
I am trying to understand COM memory layout and using C++ classes just confuses me. In general I understand what is going on with the double indirection of function pointers but as so often is the case in programming one must understand the ugly details – not just the generalities. … | |
Is there a reliable, cross-platform way to pause a program for a set amount of time? The getch() function will wait for user input, but I would like to be able to pause for say 3 seconds. If a for loop is used like so: [CODE]#include <iostream> using namespace std; … | |
Hi, i've been trying to find out how do i make a full screen using VSC++. What i have done so far is setting it to auto resize to full screen, removed the status bar, the "close max and min button on the top right corner", the icon and system … | |
by using functions, write a CPP program that calculates a water bill for a user. In order to compute the water bill, user needs to input the unpaid balance, the current and previous meter reading. RM1.10 will be charged for every thousand gallons. A surcharge of 2% is added to … | |
Hi, im having a bit of trouble when it comes to outputing a path to a folder and not a file. Firstly Im using borland c++ builder 6 and it does come with an open and save dialog feature. My problem is it wont let me path to a folder … | |
Please help me to make a sequencing program for my Operations Research subject. By this program, i basically need to sequence n jobs in an order. There are three column: jobs, A, B as shown below: Job A B 1 4 5 2 3 6 3 5 2 4 1 … | |
I have a problem with a redefinition when open a form. From Form15 I open Form13 wich works great: [code] #include "Form13.h" Form13 ^form13 = gcnew Form13; form13->Show(); [/code] Now when I add the same code on Form21 I will have the compilererror below: Why does this happen ? The … | |
I'm trying to read from a text file multiple times but I only seem to be able to read the data once. Any advice would be greatly appreciated. [code] string input; while (!ifile.eof()) { getline(ifile,input); cout << input << endl; } while (!ifile.eof()) { ifile.get(ch); cout << ch; } [/code] ![]() | |
hello, im trying to make something using quotes in a string which is then used by system(d.c_string) heres the code: [code] #include <iostream.h> #include <string> using namespace std; int main() { string a,b,c,d; a="del C:\\users\\robocop\\desktop\\\""; cin >> b; c="\""; d=a+b+c; system(d.c_str()); } [/code] Lets say when running i type 'a … | |
Hi, how can i get windows font handles in my program ? thank you all , in advance. | |
Hey! :) I found the functions in the chilkat-library usefull, so i downloaded it. If you havn't figured it out yet, I use the programming language C++ and i use the visual studio express IDE. What I do, is: 1: Save the chilkat-folders at the HDD. 2: Open Project/solutions-settings and … | |
Hi I have a some general questions, some are c others are c++ related. So I'll just post them here in the c++ forum. These question only relates to speed not so much design issues. So far most of my programming has just been about making it work. That is … | |
Hello I need an editor or IDE to edit source files over FTP. Sources and the development environment is on a Unix server and I need to edit these files. There's an editor or an IDE plugin to do this? Thanks in advance. ![]() | |
I was wondering if anyone was familiar with reading data from a file into your program. I tried using the file stream the same way cout is used but it doesnt seem to work properly. Would the getline(); function work? If so, how would that be implemented? [CODE]#include <iostream> #include … | |
I'm interested to lean C++, but I don't have any idea about which book is good for beginners any suggestion will be appreciated. Thanks in advance | |
How can i get the time from the system clock in nanoseconds?? im using c++ here.. thanx.. | |
in my program [ICODE] class list /// list class { private: int *Data; int Size; num; public: list() // constructor { size = 1; num = 0; } void add(); // member function }; void list::add() /// { char choice; do { Data = new int[size]; cout<<" \n Enter item … | |
i want to write a program that determine a student’s grade. It reads three test scores (between 0-100) and calls a function the calculate and return a student’s grade based on following rules: (a) If the average score is 90% and more, the grade is ‘A’ (b) If the average … | |
"I want to write a program that determine a student’s grade. It reads three test scores (between 0-100) and calls a function the calculate and return a student’s grade based on following rules: (a) If the average score is 90% and more, the grade is ‘A’ (b) If the average … | |
Hey..i'm new here and i'm actually taking a course related to C++ Programming. My assignment is to create a simulation on an agenda.. the agenda is a daily agenda, it only works for one day (so you will not see what day it is, it's general) it stores info in … | |
Hi, given a char(8bit's), I want to get the value of every 2bits, so that a char will contain 4 values. This is easily done with a shift left command (<<2). As far as I understand, char arrays are simply the different chars in consecutive order in the memory. so … | |
I am using Visual Studio 2008, and i am working with a single document application, it is CView Based, and i want to know how i can in addition to the view, that i will be drawing on, how i can add controls, like CButton and CListBox. do i have … | |
Hi, I'm learning c++ at the moment and the problem I have is probably very simple. I wrote some code to calculate prime factors of a given number. If I define variables as unsigned long, the code compiles and the program runs. If I define variables as double then compiler … | |
What's wrong with this program?? [code=cplusplus] #include <stdio.h> int main void { int a,b,c,d; float avg; printf("Please insert score test 1: "); scanf("%d",&a); printf("Please insert score test 2: "); scanf("%d",&b); printf("Please insert score test 3: "); scanf("%d",&c); avg=(a+b+c)/3; } { if (avg>=90); printf("Your Grade is A"); else if (avg<90); if … | |
hi ppl, im having a problem with this program. The thing is that i need to enter the license, age and level of education of an amount of ppl, but dont know how many. then i have to get the percentaje of runners and sellers, the average age, amount of … | |
hi, when I try string.size on accentuated words, the result is bigger than it was "supposed" to be, as accentuated characters count as 2 size units instead of one. how can I count them as one? cheers | |
Hey guys, How would one create a vector of pointers to functions? I know from C to create an array of functions, but I'd like to learn how to do it with vectors as well. Here are my efforts so far: [code=cpp]#include <iostream> #include <valarray> #include <vector> #include <ctime> #include … | |
Hi, I study C++ myself and can't solve a little problem. I created class konto (account) and it works fine. Now I want to create a class bank which contains several accounts and it should be possible to add a new account and to find a necessary account by number. … | |
hi again :) i was wondering how i would make a file automatically open with a program, eg: like after you install dev c++, .cpp files automatically open in the editor. how does the editor get the file's location? and how does it process it? | |
In any payroll program, how does the program values (e.g employee id, hours worked,hourly rate) work with an .in file. Does the .in file have to be in a specific folder....I am using Bloodshed Dev C++. | |
just one problem my program is about high school dance cost report its project 07 1 of 2 projects left in the class and im almost done with im only having one problem i been trying to fix this problem for a few hours with function, and anything that could … | |
I want to be able to activate an easter egg in this program, but passing and reading these arguments is making me pull my hair out. Any ideas? [CODE]#include <cstdlib> #include <iostream> using namespace std; //(cc) 2008 Nathan Barndt //Attribution-Share Alike 3.0 United States License void easteregg() { //easteregg code … | |
does any one can recomend me resource to learn mfc , cause all the web site i been through is too hard for me,plz(>w<) | |
good day! can anyone teach me how to access images and display these images using c++?because i have a project regarding accessing and viewing images in mobile phones...kindly help me...:sad: | |
I would like to have a global way to do something like this [code] #ifdef GRAPHICS //do some stuff that relies on graphics libraries that may or may not be installed #endif [/code] The problem with defines is that they have to be defined in every file, or at least … | |
I need to run simple tests on a Linux cluster fro parallel programing. I have used only C++ before, but this Compositional C++ is not that good idea as I thought at first. I have read that there is also MPI libraries and High performance Fortran, but I have no … | |
Hi, What is the dynamic array equivalent to this? int *array[10] --- int *array array = new int[10] I want something like the above, but I can't seem to figure out the correct way to do it Any help would be appreciated! Thanks! | |
Hey guys. I'm just trying out something with the fstream library. In the next code, I'm trying to read from the beginning of the array (num1) and from the end of the array (num2) the file I have as an "entry" called "entrada.txt", which has the numbers 1 up to … | |
This is strstr() function made by me as given in the practice problem. [code=c++] char *cstrstr(char s[],char ss[]) { int l1,l2,i,j,k,flag=0; char *p=NULL; l1=strlen(s); l2=strlen(ss); for(i=0;i<l1;i++) { //cout<<"i:"<<i; p=&s[i]; if(ss[0]==s[i]) { for(k=i,j=0;j<l2;j++,k++) { //cout<<"j:"<<j<<"k:"<<k; if(ss[j]==s[k]) { flag=1; continue; } else { flag=0; break; } } } if(flag) return p; } … | |
actully hv some problem in creating an assigment in my college assigment is about to draw a flow chart of online shooping frist to show the avaliable online shopping things then about shopping cart and at last calculation of all the bill :( i m vry much helpless | |
assigning the address of a variable in c++ hi all, im very new to c++ and programming, googled this but couldnt find an answer if i want a instance of a variable, i can do this int a = 10; int & b (a); so now the address of both … |
The End.