49,761 Topics

Member Avatar for
Member Avatar for nabil1983

im writing a cd database program, i need to know how i can enter characters in a field which include numbers and letters. neone know what the type is for this. i've tried the following: char album[50]; char s1[50]; none of these work they only allow me to write characters …

Member Avatar for winbatch
0
106
Member Avatar for kharri5

Hello all, I have posted many times questions about Java related topics. This would probably be one of my few C++ postings. The problem I am having is printing out the contents of a vector declared in a class, and inherited in other classes that need to access it. I …

Member Avatar for perniciosus
0
244
Member Avatar for sahil_logic

[code]#include<iostream.h> #include<conio.h> int main() { int a[10],temp,bak; cout<<" enter the elements "<<endl; for(int i=0;i<5;i++) cin>>a[i]; int m=a[0]; for(int j=0;j<5;j++) { if(a[j]>a[j+1]) { temp=a[j]; a[j]=a[j+1]; a[j+1]=temp; } } cout<<endl; for(int k=0;k<5;k++) { cout<<a[k]<<endl; } getch(); }[/code]

Member Avatar for perniciosus
0
185
Member Avatar for Asif_NSU

I've recently swithed from borland C++ 5.5 to MinGW. When I try to compile a .c file using gcc it compiles fine, but when I try to compile a .cpp file using gcc it produces a bunch of errors with c++ specific constructs. If I compile .cpp files with g++ …

Member Avatar for perniciosus
0
186
Member Avatar for smartintelleng

Very simple request, just show me how, in a new windows form application, how I can create and ajust the mount of lets say squares in parent window. Lets say theres a default of 20 squares. But I want to be able to ajust this, in such a way that …

Member Avatar for perniciosus
0
115
Member Avatar for Niklas

I am a novice to C++ but I am trying to improve. Ive started reading quite a few books which include: Learn C++ in 10 minutes - Jesse Liberty C++ Game Programming - Michael Dawson Im still in the first 100 pages in both so im not into to advanced …

Member Avatar for Niklas
0
107
Member Avatar for smartintelleng

Very simple request, just show me how, in a new windows form application, how I can create and ajust the mount of lets say squares in parent window. Lets say theres a default of 20 squares. But I want to be able to ajust this, in such a way that …

0
57
Member Avatar for sahil_logic

//square matrix #include<iostream.h> #include<conio.h> #include<stdio.h> int main() { void diagsum(int a[10][10],int n); void rowsum (int a[10][10],int n); void colsum (int a[10][10],int n); int a[10][10]; int n,opt; cout<<" enter the size of matrix (say 4 for 4/4etc..) "; cin>>n; for(int i=0;i<n;i++) { for(int j=0;j<n;j++) {cin>>a[j]; } } for(int k =0;k<n;k++) { …

Member Avatar for dwks
0
108
Member Avatar for bucsoldier03

i have to convert a program from c++ to C language and at one point in my program im stuck where its dealing with dynamic memory of an array. i started it but i dont know how u do dynamic memomory in c language. [code] if (reply == '1') { …

Member Avatar for dwks
0
226
Member Avatar for sahil_logic

#include<iostream.h> #include<conio.h> int main() { void sortarray(int array[15],int size); void mergearray(int ar1[15], int ar2[15], int ar3[30],int m ,int n); int m, n ,ar1[15],ar2[15],ar3[30],array[15],size; cout<<" Enter the size of the arrays "<<endl; cin>>m>>n; cout<<" Enter the elements of first array "<<endl; for(int i=0;i<m;i++) cin>>ar1; cout<<" Enter the elements of second array …

Member Avatar for dwks
0
190
Member Avatar for guideseeq

Hi all, I've programmed [B]C[/B] & [B]C++[/B] during my college days. I understood its [I]OO model[/I] and coded many examples (this helped me in OO [I]PHP[/I] now). I used something called [I]Turbo C++[/I], a set of some confusing files, which can be carried in a floppy or two. [QUOTE]I now …

Member Avatar for perniciosus
0
436
Member Avatar for heavyc

Ok i am having alittle problem with my code, I am getting 4 errors for having these things unidetitfied but they are so I dont know what is is here is the code that I have so far. The object is to have counters that will count how many comparisions …

Member Avatar for perniciosus
0
192
Member Avatar for taha umar

Write a program that calculates the average marks of three subjects of a student, entered by the user through keyboard and store them in three different float variables having names marks_subject1, marks_subject2, marks_subject3 The formula to calculate the average is: average = (marks_subject1 + marks_subject2 + marks_subject3) / 3 Your …

Member Avatar for perniciosus
0
161
Member Avatar for bucsoldier03

I have to develop a C++ program that reads the data records from the input file and stores them in a dynamic array of structs, which should be sized just enough for the problem. (TIP: Your program should first scan the input file to determine the number of records to …

Member Avatar for dwks
0
154
Member Avatar for sahil_logic

[code] #include<iostream.h> #include<conio.h> #include<stdio.h> int main() { void palcheck(char str[]); char ans; char str[20]; do { cout<<"Enter the string to check if it is a palindrome. "; gets(str); palcheck(str); cout<<"\nEnter Y to continue. "; cin>>ans; }while (ans=='y'||ans=='Y'); } void palcheck(char str[]) { int l=0,k=0,flag; for(int i=0;str[i]!='\0';i++) l=l+1; k=l; for(int j=0;j<l/2;j++) …

Member Avatar for dwks
0
145
Member Avatar for smicer

Please can someone help me. i don't know where to start. i need to write a programme in c/C++. the features of the programme are stated below: Write a program for Windows XP that makes a countdown timer in your Tray (at the bottom of the screen). When you right …

Member Avatar for perniciosus
0
178
Member Avatar for pokerponcho

You created a bunch of random numbers, but say you don't want a bunch of random numbers exactly. Say you have ten members of a team and you want to give them a random position represented by 0 to 9. So you create your array and you fill it with …

Member Avatar for pokerponcho
0
243
Member Avatar for Analogsleeper

I have a program where I want to point the same ifstream to another file when I am done using it. Currently, I have it set up something like this (pseudocode): //Global File Name char *mmFileName[50] void calculateISI() { ifstream minmaxFS; //sets the global file name if(condition) setGlobalFileName(); while(//assume true) …

Member Avatar for Analogsleeper
0
452
Member Avatar for sahil_logic

#include<iostream.h> #include<conio.h> int main() { int a[5],loc,val,ans; do { cout<<" enter the elements "<<endl; for(int i=0;i<5;i++) cin>>a; cout<<" enter the location u want to edit with respect to zero "; cin>>loc; cout<<" enter the val to be inserted "; cin>>val; for(int j=6;j<0;j--) { if(j==loc) a[j]=val; else if(j>loc) a[j]=a[j-1]; } for(int …

Member Avatar for Asif_NSU
0
112
Member Avatar for love13chess

Hi guys: I am very very new in C++. In school they required me to write a program that reads the names of the students registered for a class and output that result in a file. I got almost everything done. The only problem is with the function getline. I …

Member Avatar for Dave Sinkula
0
131
Member Avatar for mym

This program uses an ancient method to find the square root. But the problem is that it only works with certain numbers not all the numbers I input. I would like to know if I am doing anything wrong. I would appreciate any help I could get with this. [code] …

Member Avatar for Rashakil Fol
0
204
Member Avatar for sahil_logic

hello everyone i was trying to make my own own string concatenation function but wasnt able to do so. i need ur help.

Member Avatar for Dave Sinkula
0
1K
Member Avatar for mtodd51

I just finished a simple slot machine program. It displays 3 random numbers from 0 - 9 next to each other. I'd like to "soup" it up. Is there some way I can make each of the the numbers spin and stop sequentially. thanks

Member Avatar for WolfPack
-1
647
Member Avatar for Acidburn

[code] { cout <<" file found ..." << endl; while((ch = infile.get()) !=' ' ) { cout <<"\nRead value is : "<< ch<<endl; cout << "calling function : "; populateArray(ch, i); } } [/code] file contents : if ( a + b ) ; basically its taking the file pointer …

Member Avatar for WolfPack
0
82
Member Avatar for Zababa

Hello there, guys! I am relatively new to programming in C, and I still have a lot to learn. I am currently using Dev C++, but I work in C only. My problem is that I need to fill a 2D table with some multi-character variables, and I don't know …

Member Avatar for jim mcnamara
0
414
Member Avatar for imanust

I am trying to output a number of lines, given by the user, of stars shaped as a triangle below: [code] ********* ******* ***** *** *[/code] i have got the following code: [CODE]void line (int n, char c) { for (int i = 1;i <= n; i++) { for (int …

Member Avatar for WolfPack
0
96
Member Avatar for johnray31

when i compile this program [CODE]main() { struct emp { char name[20]; float sal; }; struct emp e[10]; int i; for(i=0; i<=9; i++) scanf("%s %f", e[i].name, &e[i].sal); }[/CODE] it gives the Floating point formats not linked but when i run this [CODE]main() { float x; scanf("%f" , x); }[/CODE]<< moderator …

Member Avatar for johnray31
0
450
Member Avatar for jack223

Question: counts how many times the number 5 appears in array called NumArray? Can anybody help me with this problem?? I got 4 "5s" but i don't know if i understood the question correctly or not....does "55" counts as two 5s??? and if it does then how do i count …

Member Avatar for geekbutproud
0
2K
Member Avatar for kahaj

Can't get this to compile for some reason. Anyone have an idea what's going on with it? [code] #include <iostream.h> #include <stdlib.h> #include <iomanip.h> #include <time.h> void MoveT(int *tortoisePtr, const int End_race); void MoveHare(int *harePtr, const int End_race); void PrintCurrentPosition(const int *snapperPtr, const int *bunnyPtr, const int End_race); int main() …

Member Avatar for Dave Sinkula
0
236
Member Avatar for DotNetUser

I have created three timers(5sec,5sec, and 10sec) for my Windows gui. When the timer event is triggered, it displays an Timeout error to a textbox. For some reason, the timers doesn't trigger in some procedures but does in others. I don't believe any process is holding up the code to …

Member Avatar for DotNetUser
0
128

The End.