49,760 Topics

Member Avatar for
Member Avatar for fragtech

In my c++ book they give a program that finds the prime numbers between 1 and 100. The problem I am having trouble understanding is the logic of the second for loop. I know what it does but not how, if that makes any sense. [CODE] #include <iostream> using namespace …

Member Avatar for mrnutty
0
533
Member Avatar for DMC[au]

Hi, I've been writing a program that encrypts and stores passwords (it's for uni, I'm a newbie), and I'm having a problem with some misbehaving variables. I hope someone can shed some light on it for me. :) I have a function which takes a string as a parameter and …

Member Avatar for DMC[au]
0
263
Member Avatar for jmoran19

Hi, I'm looking for help writing a program to check an input file for errors in its pattern. Basically, I've got a file of thousands of lines like this: "70 20000731 210202 19 36005 354 55.369 -37.207 -54 0.847 491 0.981 0.985 278977" I have no trouble opening the file …

Member Avatar for jmoran19
0
110
Member Avatar for hezfast2

Hello, I've attached my code, I keep getting the Debug Assertion failed, Expression: string subscript out of range error I can't find any errors in my logic and code for the functions, but obviously something is wrong, no matter where I put breaks, i still get the error when debugging. …

Member Avatar for StuXYZ
0
536
Member Avatar for abdelhakeem

hi all i need some help with time.h for in the following: i want to make a programme in which while time is 12:00 PM, It prints a Web-page USING time.h thx,,,, kim00000

Member Avatar for abdelhakeem
0
171
Member Avatar for LSUchemist

I have an assignment to write a program using 1D and 2D parallel arrays with input coming from a .data file given to us. I am nearly a complete novice with writing code and right now I am having a very hard time getting my program to write any values …

Member Avatar for jonsca
0
92
Member Avatar for aznswti85

I AM HAVING A HARD TIME WITH STRINGS. I DO NOT FULLY UNDERSTAND IT. THIS IS FROM A BASIC INTRO C++ CLASS HW PLEASE HELP THIS IS THE QUESTION Write a program that uses cin to read a given name (like Louis) and a family name (like Armstrong) into two …

Member Avatar for IT seeker
0
161
Member Avatar for IT seeker

aslmolikum im new member here, hope u ppl ll welcum me warmly, i m student of MIT, im having problems in C++ so i want to learn from here, plz help me out,.....

Member Avatar for IT seeker
0
77
Member Avatar for caprio.nups

I have a 10x10 matrix.basically this matrix is a square of 50 cm.and In this square we cut circles of diameter 5 cm each.The x and y co-ordinates are specified.I need to fill the martix depending on the circle it represents(with the help of given x and y co-ordinates). I …

Member Avatar for power_computer
0
105
Member Avatar for RahulJain83

Hi, I am Rahul. We have a complete software written out (with n other shared libraries maintained by various other teams). The shared libraries are loaded at run time by the main executable depending upon what feature user wants to run. All across our code, we are using printf and …

0
85
Member Avatar for sbmcdeshan

Hi I have a pointer generated in a method. And this pointer is input to another object. So at what point I have to delete this pointer? [CODE] method() { TEnemyCharacter *tenemyCharacter = new TEnemyCharacter(this); } [/CODE] So how to delete this tenemyCharacter. I cannot use delete tenemyCharacter; at the …

Member Avatar for sbmcdeshan
0
147
Member Avatar for power_computer

Ok, I have a given template class code the only thing we are to implement is inserting an item so that the template array list is still in ascending order my template passes the parameter of another class, this classes contains overloaded operators < > == based upon the win …

Member Avatar for Tom Gunn
0
112
Member Avatar for StaticX

HI, Today im tying to build a game program,im not really stuck on the coding aspect but its the concept of the 2 players in the game that is confusing me. For a starters, the game has 2 players.Player one goes first,after their go its player twos turn and so …

Member Avatar for StaticX
0
80
Member Avatar for #www#

i want a code to store a decimal number as a string i'm working on a progeam to convert a binarry number which entered as a string from user to decimal number stored as string. i have done the converting from binary number to decimal integer but i couldn't store …

Member Avatar for #www#
0
142
Member Avatar for lotrsimp12345

I have a dynamic array and i am trying to create a iterator class to support the list. I am adding begin and end. As well as a new class. error C2146: syntax error : missing ';' before identifier 'begin' Error 7 error C2146: syntax error : missing ';' before …

Member Avatar for lotrsimp12345
0
99
Member Avatar for xxDivineVinny

How would i use the find function in splay tree for the following code? I want to be able to see if that node is in the tree, and if it is not, then i would want to be able to return false. here's the link to the splay tree …

Member Avatar for Tom Gunn
0
232
Member Avatar for edwar

i've writtn a c++ code, and i like to count the output,i mean 1 --- 2 3 like that, the code is good just the counter, everytime when i run the program i got this kind of error ISO C++ forbids comparison between pointer and integer i really don't know …

Member Avatar for edwar
0
353
Member Avatar for NICEGUY123

What I am trying to do is redirect all my cout to a file, rather than a console. I am using a gcc complier to run my program. It works well when I do ./a.out > output.txt. But i was wondering is there a way i can do the same …

Member Avatar for ryuslash
0
70
Member Avatar for fhast

hi, i want to ask.. is it can to get an input from the user by only call the class object? here's the code : #include <iostream> class Time{ private: int time; int minute; int sec; ... }; void main(){ Time t; cin >> t; cout << "The time is …

Member Avatar for fhast
0
7K
Member Avatar for crystality

Hi! I can compile the following code, but when I try to run it with the line [B]a.out File1.txt[/B], my programming partner get a seg fault, and I get this error: [INDENT]a.out: relocation error: a.out: symbol __cxa_allocate_exception, version XXABI_1.3 not defined in file libstdc++.so.6 with link time reference[/INDENT] I found …

Member Avatar for dkalita
0
353
Member Avatar for AdRock

I am reading a line of text from a file and need to split it into tokens. [QUOTE]This is a test and test number is: test(001)[/QUOTE] I need the tokens to be [QUOTE]This is a test and test number is : test ( 001 )[/QUOTE] How do i split a …

Member Avatar for Clinton Portis
0
366
Member Avatar for safaha

i have an assignment to write a program in which conversion of decimal digit into binary, octal and hexadecimal take place using if, switch, do-while, nested-if or nested-if-else statements.... can you help me plzzzz...... i m new comer in i.t and simply have no information about C++ :icon_sad:

Member Avatar for Grn Xtrm
-3
108
Member Avatar for Ashishinani1756

How can a make a directory in by writing c++ code and transfer files made by me in c++ to that directory

Member Avatar for dkalita
0
98
Member Avatar for crystality

Hi! I'm getting this error when compiling: $ g++ index.cpp index.cpp:85: error: 'friend' used outside of class index.cpp: In function 'std::ostream& operator<<(std::ostream&, const GrabStuff&)': index.cpp:88: error: 'myLineNumbers' was not declared in this scope Links to included files: [URL="http://users.cs.fiu.edu/~weiss/dsaa_c++/Code/mystring.h"]mystring.h[/URL] [URL="http://users.cs.fiu.edu/~weiss/dsaa_c++/Code/string.cpp"]string.cpp[/URL] [URL="http://users.cs.fiu.edu/~weiss/dsaa_c++/Code/SplayTree.h"]SplayTree.h[/URL] [URL="http://users.cs.fiu.edu/~weiss/dsaa_c++/Code/QueueAr.h"]QueueAr.h[/URL] And for fun: [URL="http://users.cs.fiu.edu/~weiss/dsaa_c++/Code/SplayTree.cpp"]SplayTree.cpp[/URL] [URL="http://users.cs.fiu.edu/~weiss/dsaa_c++/Code/QueueAr.cpp"]QueueAr.cpp[/URL] [CODE]#include <iostream> #include <fstream> …

Member Avatar for crystality
1
680
Member Avatar for aksn315

welcome :icon_smile: I am searching about books (PDF) that talks about Analysis of Algorithms in C++ step by step ...........................................

Member Avatar for aksn315
-1
142
Member Avatar for amroto

Plz guys i have a problem in my c++ simple calculator, I made everything great but i just need an important hint for my assignment that i can't figure it out. for example when i add two numbers(2+4) the result is (6)... i need the number (6) to be stored …

Member Avatar for gbantsi_2
0
123
Member Avatar for MasterDucky

Im trying to write to the list box "Win_1" with SendMessage() but im doing something wrong. Thanks in advance! [CODE] #include <windows.h> #include <tchar.h> #include <string> #include <iostream> #include <richedit.h> #pragma comment(lib,"user32.lib") #pragma comment(lib,"Gdi32.lib") using namespace std; #define IDB_TEXT2 101 #define IDB_TEXT3 102 #define GetF 103 HWND hwnd, Win_1, Win_2, …

Member Avatar for MasterDucky
0
203
Member Avatar for power_computer

I previously asked how to install the CC compiler earlier, I decide to share my knowledge of how this compiler instead of g++ I installed this compiler because the CC compiler can handle separate template class files. I hope this is useful to some when looking for a separate C …

0
69
Member Avatar for 0xe9

On windows XP (compiling with visual studio 2008) my calls to open thread result in the following error code: OpenThread() failed: 5 I cant figure out the problem, nor what error code 5 is? Any help is appreciated :) EDIT: Then if i change my OpenThread call to: OpenThread(THREAD_SET_INFORMATION, FALSE, …

0
42
Member Avatar for Afaq Haider

Hi, Friends plz help me to Convert infix expression to postfix expression using stacks (simple C++ program), I m new to c++ so i don't knw too much abt c++, write a simple program for me, i have just five days more for submitting my assignment, so plz help me, …

Member Avatar for boiamz
-1
117

The End.