Main Topics
Browse All Topics This is a question relating to the buflab and bufbomb assembly project. This is for phase 2, named Firecracker. I've noticed it's been asked on her before and while I think I have most of it I can't seem to get the last part.
Level 2:...
Hi, i have to load some images from a url and the problem is that the images only show when i scroll the view. I think the problem is related to the HJManagedImageV helper classes, maybe it isnt storing the images, just guessing :)
My code is...
Hey,
I have seen help with this on several occasions here but I cant figure my bomb out. Please help I must be over-thinking something. I need to find six number in order for the bomb not to explode. Here is what I got so far.
Here is the...
Through Guru.com, I had a developer create a DLL for me to include in a Visual Studio Windows Service project. To test out his DLL, this developer included an EXE that would register the DLL on the system and he included the following code...
(( Please look for more questions under iPad App Programming .... ))
I downloaded XCODE, purchased an iPad, upgraded to Lion (OS x 10.7) bought XCODE tutorial app. Also finding good tutorials.
Getting ready to order Head-First App...
I'm using the Eclipse CDT IDE (Helios) with the MinGW toolchain under Windows for a C application.
I'm having a problem using static libraries. I'm not even getting to the point of calling functions in the library. What's happening is the...
I'm writing a mobile robot C program which reads data from a serial port to check some sensors and then try to load a joypad to control two servos.
Since i'm using a blocking read to acquire data for sonars from serial port, i can't get input...
I am new to Objective-C but I think I would like to create:
1) An Abstract class which performs certain functions needed by child classes, but should not be instantiated directly.
2) A Protocol that forces child object to conform to a...
Hi there, I was just wondering if it is possible to make a client + server application that would allow the client application send data via servers ip address.
Basically client's application would only have a webbrowser in it, but all the...
I have a small C++ server and a java client. I send data from the client to the server. The recv() function of the server side does not receive the the data. I receive the size -1. But the otherway about works well (i.e. from server to the...
I wrote a structure called "time" in Main, and I created a pointer to the structure called timePtr that I'm trying to pass to many functions. I'm getting the error "dereferencing pointer to incomplete type" and I don't understand why.
There...
#include <iostream>
#include <map>
#include <string>
main(int argc, char* argv[])
{
std::multimap<int, int> test;
test.insert(std::pair<int,
}
CC mapTest.C
"mapTest.C", line 51: Error: Could not...
Hi Experts,
char* pszFind = strstr(CStr()+uStartIndex,
I got the following error :
cannot convert from 'const char *' to 'char *'
I need help tp resolve this problem ?
Thanks,
How to configure Date and Timem in Unix bash chell script and then write the message on the screen or into a file?
Please comment what else neededs to be added (or may be deleted from) to my code below:
# Date and Time configuration
...
Hi
I'm in need of some advice. I have a tcp dump in which I need to write my own custom sniffer to detect any corrupt tcp packets. The tcpdump contains packets that I have modified to hide hidden data. This has been done by using a kernel...
Hi all,
i got this error while doing make (compiling all my files tgt).
Can anybody tell me why is this happening, and how should i solve this?
because my codes runs fine on the other machine but not this.
Thanks in advance:)
$ make
gcc...
int _tmain(int argc, _TCHAR* argv[])
{
const char *p="Hello";
p="Happy";
cout<<p<<endl;
return 0;
}
How does memory management concept works here. Will the NULL added at the end of the word? if So why?
I'm developing a mobile robot application and i'd like to add a text to speech function which let the robot "talk" with the humans by reading some text strings which i'll pass to it.
For example, since my robot has a sonar network, i'd like to...
Hi -
I'm working on my program this morning and I'm trying to determine why my first scanf statement works but the second one does not. It compiles normally. It runs fine. It reads the first resp1 and evaluates it correctly. However if i...
Hi,
I'm running through some exercises in a book.
The problem is to read in a file of names/words. Determine which words in the file (one word per line) is a proper name as well as a 'regular' word. This is more of an exercise in using...
Hi Experts,
Is there a secure way of converting string to int. I can use atoi( ) but, I am not sure if this is secure.
Hello
I need a command to trace every aspect of info as system call tracer for a process (say pid 1234, procesname-abc)
Please let me know the command with the options.
my process is PA-RISC process running on hp ia64 hardware thru aries...
I am new to pcap programming. How do I get to the epoch time for the packet? I suppose it is in the header.
Hi Experts,
I am experimenting with how memory is allocated on the heap. It appears, when I do malloc back to back, the first one returns an address in one page, and the second one returns an address in another page(4096 bytes page size). I...
Hello
Can someone advise how I can extract the first 8 bits and last 8 bits from a 16 bit integer.
for example decimal 64339 = 11111011 01010011
I need the 1st 8 bits decimal 251 (11111011) and then the last 8 bits decimal 83 (01010011)...
I'm have a SWIG generated dll and java libraries. I need to be able to reload the library after it's been used, I know it's not the ideal situation and I should be looking to fix what ever is in the native file but I've inherited a project with...
Hi - As you can tell by my posts, I'm in the learning stages of the C programs. I think I goofed by not declaringin my array in the main, rather than the get_randno() function. I need to pass the array values back to the main so I can use them...
I'm administrator on my PC. Only I'll be using mingw. Is it going to cause any problems if I install it as an administrator?
Please see attached file.
Hi -
I'm attempting to create a two dimenional array from an existing one dimensional array. (see function create_2dim). I'm not getting any compiler errors, but when the code runs, I'm getting addresses rather than values from the one...
I'm having some problems with g++ and the compiling process for a C/C++ program which use Bluetooth libraries under Ubuntu.
If i use gcc, it works fine with no warning; on the contrary, if i use g++ i get this warning:
warning: taking address...
Hi am trying to compile the below code using visual studio 2010
template<class E> inline
void insertId( std::set<E>& s, E e )
{
if( e )
s.insert( e );
}
void GrammarGenerator::insert( ASRS& asrs,
GramStr whatStr,...
I have a function like:
char testData[256] = "This is my test data";
bool dataReturn(void * data, int nSize)
{
// put testData into data
return (1);
};
and I want to put some data into 'void * data' from within my function and have...
Hi, I was hoping someone can help me out. I'm running Linux Mint on a Windows 7 VM and I need my C programs to access memory locations at their will but this program gives me 3.14 twice which the second output should be different.
I mean it's...
My C skills are obviously rusty. I'm getting a segmentation fault on the mysql_query call -- line 21 in the snippet below.
Can you tell what I'm messing up? I suspect it has to do w/ *'s or &'s.
Thanks!
Good evening -
I am having some difficulty with a field that is being read from a text input file. I need to determine if the value is an odd number. However, when I try to calculate using the field I get sharing violations. I've even...
Hello,
I've written some application in C on an old SuSE Linux 8.0 (i386) many years ago and need to compile it on a SLES11 now. To simplify, I installed a VM with the 32bit version of SLES11.
On the SLES machine I get many warnings when...
I'm trying to convert two integers into strings, concatenate them, and convert the result back to an integer. I'm not sure the best way to do this. I tried using sprintf but it didn't work and the characters were null when I printed them out.
...
hello there,
I have a lot of lines in a text file with one line per line like this.. sample
thomas|smith
bob|smith
dan|lois
ben|foster
I would like to know how can I make a little c or c++ app that can read the data from the text file...
Hi Experts,
I have the code below. If I have 100 items in my vector, I'm only getting back 29 of them when i look at the result of oss.str().... is there something wrong with this code? Thank you!
Hi all,
As what i know when you fork() a process, parent process and child process will be able to access the same global variables.
But i'm having the issue that when i changes some values in the child process, parent process isn't taking the...
I'm trying to get my app to work with Thai characters. I've been sent a win7 laptop with thai language pack installed (in the task bar you can toggle between EN and TH to switch between THai and ENglish input). Many things work. In some...
In the user_input function in my code, there are three scanf statements that accept three integers. No matter what values are entered, the printf statement after the scanf statements show each value to be "1". Can you think of a possible...
If i compile my code with gcc under Ubuntu i get no warning and everything works good.
If i compile the same code with g++, i get this warning:
warning: pointer of type ‘void *’ used in arithmetic
This is the code:
However, the...
void func(char *t)
{
t="rajesh";
}
void func1(int *t1)
{
*t1=11;
}
int _tmain(int argc, _TCHAR* argv[])
{
char *p="praveen";
func(p);
cout<<p<<endl;
int i=10;
func1(&i);
cout<<i<<endl;
return 0;
}
In the above...
Hi Experts,
I am trying to understand how to analyze a double free error. I have the following simple code. When it crashed, I collected the core dump.
When I loaded the core dump into GDB, I have the followings. I am wondering why...
is there software to have the a "file folder" show the size in a column to the right on windows 7?
I'm setting up an Eclipse + msys + mingw environment to build a C application. When I start a new project in Eclipse, I have to change the compiler and linker commands under C/C++ Build - Settings from just gcc to C:\msys\1.0\mingw\bin\gcc.
I'm using a C program with termios to exchange information and commands between my pc with Ubuntu and a USB motor controller.
It works great and i'm able to successfully send messages over the serial port; however, sometimes it happens that if...
I am trying to figure out the best way for users to "register" the program I am writing.
Here are my simple guidelines:
1. The program should be able to be registered without an internet connection.
2. The registration dialog box...
Hi - This is a continuation of the a previous post. I'm not sure I have clear understanding of the Pointer and Array Concept which brought on another question about my code and the pointer to the array...
#include <stdio.h>
#include...
We have a communication protocol that requires us to Base64 Encoded a SHA1 hash of a UTF-16 encoded password. We have been given Java, javascript, and visual basic examples however we are running under Linux (redhat) the provided test...
I am writing to two 7-segment LEDs and each of them are controlled with seven bits. I have each digit I want to display stored as a byte. I need to write the high and low digit values as a concatenation to the 7-segment LEDs. This is a problem...
Hello,
I'm trying to create a static array in C for some JNI testing. My goal is to have the charArray function return a pointer to a char array and then in my JNI code, I'll retrieve those results. Whenever I have more than one character...
Is it possible for a makefile to be aware of what is defined in the source code? For example, in a header file I have:
#define T5
I'd like the makefile to recognize the definition and build differently based on that:
ifdef T5
CH_Manager:...
Hi I am writing a kernel module.
I need a continuous loop that will look for tcp traffic and read from skb to store each source ip address from ip_hdr->saddr into an array
I can get it to read packets one at a time but I need it to loop,...
Hi -
I'm stuck. I'm having trouble incrementing an array that is being passed by reference. When I run the code, I can get the output to generate 10 rows of either the first value in the array or the last.. depending how I reference it. ...
How do you print a jagged array in table format? Please see code below where I'm obtaining the values from the user but having trouble setting up the display using the printf function. Here's a snippet of code. If you need all, please let me...
Hi Experts,
I have an init function for a library. The library has to finish parsing some stuffs before init returns to the caller. The parsing is done in another thread. In VxWorks, I can use the semTake()/semGive() pairs to achieve this...
Hi EE community,
I am developing a safety-critical product that complies to a safety standard--IEC 61508. Are there any affordable tools to track and manage the requirements from start of design to finish and also changes once the product is...
I am seeking information on how to write my own code for a virtual serial port for windows Xp or Windows 7. Preferrably using Borland C++ builder.
Any useful information would be appreciated.
Please note that I know of commercial software...
Hi is it possible to use strtok to parse some data using a string as the first deliminator rather than using punctuation?
for example
data here string a b c d
more data here to disregard string e f g h
so that I only get a b c d e f...
Hi,
I have a unix account on a server. When I execute the unix command history, there are
263 ls -lrt
264 more blah blah
265 ls P*
266 more blah blah
267 ls -lrt
268 ls -lrt
269 more blah blah blah
270...
I created a code in C for read a file. The code is working properly except the the last line of the file.
The problem is that for the file :
A1 20 B1
B2 10 C1
my code is read :
A1
20
B1
B2
10
C1
B2
How to fix this???
Hi -
I have one more question regarding the writing to a text file. I posted earlier yesterday and resolved the permission issues. The program is working technically... but not as expected. I'm not sure what I've done wrong here... ...
I have compiled code for a simple router program. I am taking a class and I needed to create a program that would simulate routers updating their routing tables. The only real question i have left is i'm not sure if the program should update the...
Beginning to learn some c.
Quick newbie question.
When using atoi to convert a string to an integer I've had different results.
My compiler at home will always return the max int size if the number exceeds the maximum integer value.
...
Want to have a global data structure which can be shared by several classes or shared by several files. If the data structure in one of classes is updated, the other classes can use the same updated data in their own classes. A workable code...
I'm developing a mobile robot application and i'm using a high-level board (pandaboard es) which can run linux operating system and a low I/O board to manage the sensors.
These two boards share data over ethernet while the high-level board...
Hi,
I'm in the process of learning C. I'm wanting to call a couple functions from the main which will open a text file and then write to the text file. Do I need to declare the FILE* fpNumbs in the main and in both funtions or can I declare...
I have found a few on the net but i dont want to just copy them.
Here is part of my code.
What am i missing ?
Hi -
I'm in the learning stages of programming with C. I have a question about the function for fclose. My program writes to a text file and then reads from the same file. In between these two functions, I do close the file. However, I...
In multi-homed UNIX box, for servers, we can bind a specific IP address (or all of them) and ports to the socket. In sample client code, I just see the client socket associated with the server's IP address and port. I would like this client to...
My target is based on Freescale 68HCS12 Microcontroller. I need to create small dealys in my code.
for ( ; counter != 0; counter-- )
{
;
}
Will this actually consume clock cycles or it'll just get optimized by Cosmic Compiler...
Hi,
I have a basic C pointer question.
Given this code:
int i = 17; //init i to 17
int *x; // Create pointer to an int
x= &i; //point x to the piece of memory that holds the value of i
*x=99; //...
Hi all -
I'm learning C and wanted to pose a question. Can you pass an array element to another function? For instance I'm in a 'FOR Loop' and generating the array with random numbers. I would like to perform different calculations on these...
I'm trying to figure out how to appropriately convert The unsigned char* getBytes C Function below using JNI (Java).
The getBytes function returns a buffer of sender_id_t's:
typedef unsigned char id_t[32];
struct...
In some code I inherited, written by someone else, appears:
#if ((_WIN32_WINNT < _WIN32_WINNT_WIN2K) && (_WIN32_IE > _WIN32_IE_IE60SP1))
#error _WIN32_WINNT settings conflicts with _WIN32_IE setting
#endif
No issue when building in MS...
Hi
I am creating a kern module that scans the network and displays packet information
I want to display the remote port numbers, however i can only find how to display local port numbers (tcphdr->dest and tcphdr->source) Can anyone help?
...
Once the accept() is called to spawn a socket on the server side to talk to the client, I assume by some magic that spawned socket knows the IP address of the client so that the conversation can be continued. right?
If so, is there a way I...
Hello
This is URGENT!!!
core file is not getting generated for a process(pid: 1234), after running "kill -9 1234" or "kill -11 1234"
machine is:
Linux abc.def.xyz.org 2.6.18-164.2.1.el5xen #1 SMP Mon Sep 21 04:45:50 EDT 2009 x86_64 x86_64...
When parsing xml in c, what is the easiest way to find the element between 2 tags?
I was using strtok and passing it the string and the <tag>, but when I try to find the next piece of data using strtok and the same string as the first call it...
I am attaching my code and I would like to take the command line argument and put it into buff. I would like an example on how to get that done. It seems to me it should not take to many lines of code to do it. I need to change the line that...
Hi Experts,
I am working on a shared library to provide some functionality. I want to be able to set some attributes when this library is loaded and running in a process. For example, I want to set the log level of my library based on some...
I am having problems returning a correct result_type value from ct_results from the below code snippet. Stepping through the code, app appears to be good until the call to retcode = ct_results(m_Cmd, &result_type); . This has been running for...
How do I copy files using a wild card for example ODFL214*.* to a specific folder in C
hi experts;
I need call pg_dump.exe (postgresql) and redirect console output to a text file.
This program must be written in c and works in windows and linux.
any idea?
thanks;
1. Can anyone point me to a decent Coding standards & Style guide for a C/C++ and Linux environment?
2. What are the variables for Coding standards & Style guides? I can imagine these being:
a. Flavor of Linux
b. Is there such a thing as a...
Hi Experts,
When I do the following in GDB, I get the previous function in the call stack. I am wondering how they are organized. I read this from a website, but I am not sure why disassemble main-1 would give the dis-assembly of doubelFree....
Hi ,
i want to write a program using functions , read /write files , classes , matrices for an extra credit.
I would like to be related to aerospace. Do u have any idea or any link i would get an idea ?
Hey people
I can't figure out why my code only works with every other input that I put into it. I need it to display all the SNaN and Fractbits and all that stuff every time I put a number into it. Can' you please tell me where my code has gone...
how to get a list of files from a directory matching a string (in C code)
Hi Experts,
Assuming I have the following code for creating a singleton, how can I handle if error is returned from pthread functions? What is a good way to handle it.
If I have a setter function like below, what could be the better...
Hi Experts,
I have a map as below.
typedef map<std::string, IObject*> LookupTable_t;
I am initializing the map like below.
Basically, it serves as a table for( string, function).
Can I do this initialization in something like :
...
Hello
From an C application, we are getting the following error in sys msgs
app[5678]: segfault at 0000000 rip 00003f32a823 rsp 000123ade323 error 4
My query is, Can i map RIP address (00003f32a823) to a function name by running below...
Experienced with changeable values in an array. For example, in one method, assign some value to the array and then print it. The values are correct. However in another method, try to print the array again, the values have been changed. Would...
I just need to pass some time. How do I do that efficiently?
Thanks!
How do I get local or actual file path to an image of type CF_BITMAP, CF_DIB, CF_TIFF, and CF_ENHMETAFILE currently loaded on the clipboard? I know how to get the actual image but I need to know the file path (If CF_HDROP is not specified as a...
Is there anything comparable to a map in plain vanilla C?
Hi -
I am lost and frustrated. I cant seem to make the leap from reading the text file to displaying it in the format that I need. At first I thought I could check data types and that didnt work, next I thought I could use the function...
A friend and I have hit a wall in that neither of us know any C. Would anyone who does be able to write an equivalent to this PHP function in C, preferably, although C++ would be ok?
Please let me know if any further info needed.
...
jkr
79,928
Master
0 points yesterday
ProfileInfinity08
69,220
Master
0 points yesterday
Profilesarabande
68,324
Master
0 points yesterday
Profileevilrix
22,528
0 points yesterday
ProfileZoppo
20,450
0 points yesterday
Profileozo
19,800
0 points yesterday
Profilemccarl
19,586
0 points yesterday
Profileduncan_roe
18,800
0 points yesterday
Profileambience
16,552
0 points yesterday
ProfileKdo
13,964
0 points yesterday
Profilesatsumo
13,000
0 points yesterday
Profilephoffric
12,160
0 points yesterday
Profilehmccurdy
10,172
0 points yesterday
Profilefridom
8,000
0 points yesterday
Profilemasheik
7,572
0 points yesterday
Profilefarzanj
7,332
0 points yesterday
Profilewoolmilkporc
7,300
0 points yesterday
Profiletampnic
7,000
0 points yesterday
Profileeager
6,300
0 points yesterday
ProfileTommySzalapski
6,200
0 points yesterday
ProfileHooKooDooKu
6,052
0 points yesterday
Profilefor_yan
5,800
0 points yesterday
Profilealexey_gusev
5,600
0 points yesterday
Profileblu
5,200
0 points yesterday
ProfileCEHJ
5,000
0 points yesterday
Profile