473,544 Members | 1,802 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.
5
56,168
thread by: jodelson | last post Aug 17 '07 by: Hunderpanzer
Hello all! I am sorry my first post here is a question. I hope to contribute during the posting and replies on this thread. I am stuck for 1 week in a *** stack smashing detected *** bug in my C program running in a i386 desktop with Ubuntu 7.0.4. I would have pasted the code here but its approx 2000 lines. It has a dozen of functions and a...
10
56,033
thread by: desktop | last post Oct 5 '07 by: =?UTF-8?B?RXJpayBXaWtzdHLDtm0=?=
If I have: std::map<int,intm; where I have: m.insert(std::make_pair(1,2)); how do I update the value to 7 associated with key = 1?
4
55,962
thread by: - Steve - | last post Jul 19 '05 by: Tom
I have an array of char values that I need to assign to a integer variable. I tried casting it: integer = (int)charArray; but when I run it I get incorrect results in integer. What is the correct way to cast a string to an integer?
5
55,888
thread by: Gary Wessle | last post Aug 15 '06 by: peter koch
Hi I am getting this error when running a very similar code like the below, it is made for illustration only. thanks *************************************** **************** error **************** (gdb) n
18
55,794
thread by: Toto | last post Nov 14 '05 by: brian
Hello, my problem is quite simple to explain. I have the following string: "table+camera" and I want to remove the + sign: "tablecamera". How do i do that ?
59
55,678
thread by: Umesh | last post Apr 24 '07 by: Army1987
i wrote the following program to calculate factorial: #include<stdio.h> #include<iostream.h> void main() { int i,n; long int p=1; // or long double p=1; for exponential result which I don't want. cout<<"Enter No. ";
26
55,645
thread by: Pravesh | last post Nov 14 '05 by: Michael Wojcik
Hi: is there a way to get current system time in milliseconds... which functions and headers?? thanks pravesh
11
55,495
thread by: Pontus F | last post Jul 19 '05 by: Roxann Higuera
Hi I am learning C++ and I'm still trying to get a grip of pointers and other C/C++ concepts. I would appreciate if somebody could explain what's wrong with this code: ---begin code block--- #include "stdio.h" #include "string.h" void printText(char c){
4
55,478
thread by: Dave | last post Jul 19 '05 by: Unforgiven
Is the construct #if defined MACRO_NAME part of standard C++? If so, how does it differ from #ifdef? Thanks!
10
55,128
thread by: Madhukar | last post Mar 2 '14 by: adlingepa
Hi today (9th july 2006) i attended a technical interview in aspire systems. Two rounds of technical interviews. i well in the first round and did bad in the other. The interviewer asked me to write a program to print and given number in words... say for example... if the input is 12345 then the output should be printed as "twelve thousand...
5
55,085
thread by: bobrics | last post Apr 22 '06 by: Andrew Poelstra
Hi, I am trying to link use a library created by me, and getting the following error during linking: $: sudo gcc -c mycode.c $: sudo ar rc libmylib.a myfuncs.o $: sudo runlib libmylib.a $: gcc myfuncs.o -o mycode -L. -lmylib -lm /usr/lib/gcc/i486-linux-gnu/4.0.2/../../../../lib/crt1.o: In function
6
54,970
thread by: Ramprasad A Padmanabhan | last post Nov 13 '05 by: pete
I have a simple structure defined like this struct userid { char uid; int insize; int outsize; }; typedef struct userid user;
11
54,861
thread by: Baloff | last post Aug 3 '05 by: Gianni Mariani
Hello why am I getting 6 outputs instead of just 5 from this code? thanks #include <iostream> #include <string> using namespace std;
7
54,769
thread by: padmahasini | last post Dec 20 '11 by: zidane
i am confused about static structure... static struct { int a; }st; what is the difference between static structure and normal structure?
10
54,620
thread by: srikanth123456 | last post Jul 31 '14 by: Abdur Rehman
can u guide me how to write this program my program should give outputas follows when i press a key on the keyboard it should return the "key is pressed" and also if the key is pressed more than 350ms it should return the "key is hold"
10
54,576
thread by: qazmlp | last post Nov 13 '05 by: pete
There are some blocks of C/C++ code put under #if 0 #end if Is there anyway to make the code inside these blocks to get executed (may be by using some command line options)?
15
54,538
thread by: main() | last post Aug 23 '06 by: Michael Mair
Hi all, When i compile following piece of code, # include <stdio.h> void fun(int val) { int val; /*problem is here*/ printf("%d\n",val);
8
54,434
thread by: Frank Münnich | last post Nov 13 '05 by: Micah Cowan
Hi there.. My name is Frank Münnich. I've got a question about pointers that refer to an array of a structure. How do I declare that type? If I have declared a structure struct mystruc { int x,y,z; char a,b,c;
2
54,008
thread by: Nobody You Know | last post Jul 19 '05 by: Frank Schmitt
My goal is to efficiently read a file into a c++ string, discarding newlines. Here is my first cut: bool MyClass::ReadFile( string strFileName ) { ifstream File( strFileName.c_str() ); if ( !File ) { return false; }
10
53,752
thread by: Jay | last post Nov 13 '05 by: Dan Pop
How can I cast Integer value 450 to a char array "450 "? in a c program? thanks in advance for any help.
2
53,659
thread by: ashokd001 | last post Aug 28 '08 by: mac11
Hi I want to pass argument to gdb but i don't know to do that. Say, my executable taking 3 argument. <myexe> <arg1> <arg2> <arg3>
2
53,639
thread by: Erich Reisenhofer | last post Jul 19 '05 by: Jerry Coffin
Hello! Which operatiaon causes -1.#IND ? I use complex numbers. Thank you! Erich
9
53,607
thread by: Fred Zwarts | last post Jan 26 '06 by: shaun
What is the recommended way to loop over all enum values of a certain enum type? Consider the following definition: typdef enum {A=2, B, C=5, D} E; then for (E x = A; x <= D; ++x) { ... }
22
53,466
thread by: hantie | last post Nov 13 '05 by: Joona I Palaste
In my program, for reducing the complexity, the integer was stored as char, so 2 is stored as '2', which is decimal: 50 Is is possible for me to obtain the integer value of '2' in the program, i.e. I want to process '2' as int: 2, not int: 50 ? Sorry for this newbie question.
7
53,353
thread by: d.kaufmann | last post Nov 14 '05 by: d.kaufmann
i have this part of code: typedef enum { OW_SEARCH_ROM = 0xF0, OW_MATCH_ROM = 0x55, OW_CONDITIONAL_SEARCH_ROM = 0xEC, OW_HANDLE_SELECT = 0x0F } ow_command_t;

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.