473,543 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C / C++ Forum

C / C++ programming language - Get answers to questions about compilers, visual C++, templates, namespaces, classes, data structures, OOP (object-oriented programming), inheritance, data types, exceptions, Standard Template Library (STL) and the C Standard Library.
4
2,180
thread by: Mandragon03 | last post Apr 18 '07 by: Juha Nieminen
I am looking for a way to take a floating point number and get rid of any extraneous 0's at the end. For instance if I have myFloat = 9999; printf("%f", myFloat); I get 9999.0000. I want to get rid of these 0's. Here is one catch. I also need to be able to do this:
3
2,533
thread by: dosterpf | last post Apr 18 '07 by: AdrianH
I'm working on a project, and I have an arbitrarily high number of dimensions N. I want to create a loop over all combinations for each of these N dimensions from say 0 to M-1. So something like: for(i1=0;i1<M;++i1){ for(i2=0;i2<M;++i2){ . . . for(iN=0;iN<M;++iN){ check for some condition, if...
2
17,455
thread by: nxs | last post Apr 18 '07 by: AdrianH
in the following program, I am trying to create M threads, each of which open a file called filexxxxin . for exmaple 4th thread will open file file0003.in. When I run the program, it open the client0001 file for all threads. Any body knows what's wrong with my code. appreciate your help. #include <netdb.h> #include <netinet/in.h>...
2
1,745
thread by: Nusc | last post Apr 18 '07 by: Nusc
The following program is supposed to prompt the user for a student ID. Open a text file. Calculate the student's average GPA and print his transcript. #include <fstream> #include <vector> #include <iostream> #include <cmath> #include <cstdlib>
12
1,724
thread by: siddhu | last post Apr 18 '07 by: Mark P
Hello, would you suggest to me, why gcc 3.3.3 can not compile this: template<class T> class Base { Base(){} friend T; };
7
2,877
thread by: Duke | last post Apr 19 '07 by: CBFalconer
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char *argv) { char *s = "hello strlen"; printf("%s has %d chars.\n", s, strlen(s)); //the above strlen function execute correctly char *msg1 = "abcdefghijklmnopqrstuvwxyz";
1
1,058
thread by: bluesteel | last post Apr 19 '07 by: ilikepython
I wanted to know whether it was possible to write a while where the condition was checked in every instruction and stopped if false, i mean: Considering the following coda: condition instruction 1; instruction 2; instruction n; and it should check whether the condition is true or not in every step. Does something like that exist? I could...
4
1,252
thread by: michael | last post Apr 19 '07 by: Ian Collins
Hi all, why if I can use std::vector<int>::iterator variable; can I not use using std::vector<int>::iterator;
2
2,307
thread by: mimi | last post Apr 19 '07 by: Ian Collins
Hi,all. The section 13.5.1 of the <C++ primer 3rd editionsays, a static member frunction may not be declared as const or volatile. I could not explain to myself why? The constness seems to be irrelevant to whether the function is static or non-static. Furthermore, i am not sure the following program is correct. According to the book, it...
2
2,077
thread by: KiranJyothi | last post Apr 19 '07 by: KiranJyothi
Can anyone please tell me how can I rectify my compile time error in this program. /********************************HEADER FILE***********************************/ #ifndef POLYNOMIAL_H // conditional compilation #define POLYNOMIAL_H # include <iostream> using namespace std;
1
1,631
thread by: larry | last post Apr 19 '07 by: Jack Klein
Hi, I want to run a program. However, it fails because the glibc 2.4 is not found. I invoke the ldd command and I got this. ../sublime.so: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.4' not found (required by ./sublime.so) linux-gate.so.1 = (0xffffe000) libc.so.6 =/lib/tls/i686/cmov/libc.so.6 (0xb7e77000) /lib/ld-linux.so.2...
3
2,501
thread by: cloud | last post Apr 19 '07 by: Alexander.Zen
Hi, I have a query. Will it possible to create a DLL using C++ langauge? Please explain. thank you. -vinod
5
2,787
thread by: JoeC | last post Apr 19 '07 by: anon
I am doing some routine code with dev C++ and I am getting an error when I am trying to basic functions with a vector. std::vector<nation>pl; nation n1(red); <these are constructors. nation n2(black); int z = pl.size(); <--this works just.
6
2,510
thread by: Salman | last post Apr 19 '07 by: James Kanze
I would like to know how I can distribute the application that I create with Visual C++ express edition. I checked the menu options to find a deploy option similar to the one found on the Visual Basic Express Edition but could not find one. I have even searched the help files and could not find anything useful for me. I want to simply...
8
429
thread by: Malciah | last post Apr 19 '07 by: James Kanze
I posted this on another site, but so far I've had no answers. So, I decided to try it here. -------------------------------------------------------- I've been learning C++ for about 6 weeks now, and I've been able to figure out the cause of pretty much every problem I've run into. This time, I'm at a loss. The book I'm learning from isn't...
6
3,475
thread by: gopython | last post Apr 19 '07 by: Savage
Hi all, OS: Windows XP C++: Microsoft Visual C++ 2005 I am wondering if it is possible to kill the C++ program after calling another program (i.e. .bat). I did a simple test and check the "Windows Task Manager". After the exe run the .bat the exe is still there until the .bat finished running. Is that possible to kill the .exe after the...
7
3,318
thread by: Adrian | last post Apr 19 '07 by: James Kanze
Hi, I want a const static std::set of strings which is case insensitive for the values. So I have the following which seems to work but something doesnt seem right about it. Is there a better way or any gotcha's from my code below.
1
3,468
thread by: Chris Roth | last post Apr 19 '07 by: James Kanze
I've been working with boost::threads to do some multithreading in my code and have run into some questions that I haven't been able to find answers to. I'll include some sample code to illustrate my questions. #include <boost/thread/thread.hpp> #include <iostream> using namespace std;
2
2,348
thread by: Thormod Johansen | last post Apr 19 '07 by: Michael DOUBEZ
Hi, I am doing some embedded programming in Paradigm C++, and I would like to be able to output debugging information using the << operator and ostreams. I have a serial link for which I have low level code to output one character at a time. I hope to be able to write code the following way: sout << "Debugging info: x = " << x << '\r\n';...
2
1,590
thread by: The Cool Giraffe | last post Apr 19 '07 by: Zeppe
I was told to use the following scheme. // Some.h class Some { bool doSome ();}; // Some.cpp #include "Some.h" bool Some::doSome () {return true;}
3
2,047
thread by: peter.vanna | last post Apr 19 '07 by: James Kanze
Hi, I have the following vector container. *************** class A { public: bool test; }
21
1,748
thread by: Johs | last post Apr 19 '07 by: Alf P. Steinbach
Are there any difference between writting C++ in linux or Windows? I was told that it was only a matter of available IDE's (eclipse for both platforms, but only Visual Studio for Windows) but are there other techincal/syntatical/standard library function differences? Johs
3
4,720
thread by: Bryan | last post Apr 19 '07 by: James Kanze
In unix if I want to dump some output into never never land I can do something like: std::ofstream outfile("/dev/null"); What is the equivalent in windows? /dev/null seems not to work properly. Is it std::ofstream outfile("NUL")? Thanks, B
13
30,287
thread by: sharat | last post Apr 19 '07 by: anon
hi groups, i have created 2 .cpp and .h(header) file and one main.cpp file, such as file1.cpp and .h similarly file2.cpp & .h . i have include the apropriate header files also .now i am creating the object of class A (which is declare and define in file1.h) into class B(which is declare and define in file2.h). i am getting an error that...
10
9,291
thread by: lovecreatesbea... | last post Apr 19 '07 by: David Thompson
C stops the conversion from (char **) to (const char **). c-faq.com sec 11.10 has explanation on this point. But, for example, even the conversion from (char *) to (const char *) brings the same dangerous as in the previous conversion. Why the latter simple but dangerous one is allowed in C? $ cat f1.c int main(void) { const char c...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.